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

ubuntu+web.py+fastcgi+nginx

2016-01-22 00:00 579 查看
安装环境

add-apt-repository ppa:stevecrozz/ppa
apt-get update
apt-get install uwsgi


配置web.py

app = web.application(urls, globals())
application = app.wsgifunc()


配置nginx

server {
listen 80;
server_name localhost;
...
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
}

location /static/ {
root D:\Projects\PYTHON\webpy\nginxdemo;
if (-f $request_filename) {
rewrite ^/static/(.*)$ /static/$1 break;
}
}
...
}


启动web.py

uwsgi -s :9090 -w myapp -p 4 #并发4个线程:


启动nginx

> service nginx start
> service nginx stop
> service nginx reload
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu web.py fastcgi nginx