您的位置:首页 > 运维架构 > Nginx

Nginx+uwsgi+web.py

2014-02-27 21:38 337 查看
import web
urls = ( '/', 'index' )
app = web.application(urls, globals())
class index:
def GET(self):
return "Hello, world!"

application = app.wsgifunc()


application = app.wsgifunc()

application = app.wsgifunc()

save as hello.py

配置/etc/nginx/nginx.conf

user  nginx nginx;
worker_processes  1;

events {
worker_connections  1024;
}

http {
include            mime.types;
default_type       application/octet-stream;
sendfile           on;
keepalive_timeout  65;
client_max_body_size  20m;
server {
listen 80;
server_name localhost
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:3031;
}
#
location /static/ {
alias PROJECT_ROOT/static/;
}
}
}


uwsgi setting:

uwsgi -s 127.0.0.1:3031 --processes 2 --enable-threads —-pythonpath /var/www/ --wsgi-file /var/www/hello.py


uwsgi.ini#sthash.hHJNQo0q.dpuf
uwsgi.ini#sthash.hHJNQo0q.dpuf

/etc/nginx/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: