nginx+gunicorn运行django
2012-07-26 15:01
267 查看
运行django的有fast_cgi、uwsgi和gunicorn等 其中uwsgi效能最好 但配置稍复杂 而gunicorn配置简单
在windows下通过源码安装gunicorn报错 缺少fcntl模块 最好在linux环境下使用
首先安装gunicorn 和django
gunicorn_django -D -b 127.0.0.1:8000
然后配下nginx
server {
listen 80;
server_name 域名;
root django项目目录 ;
location /static/ {
if ($query_string) {
expires max;
# log_not_found off;
}
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:8000;
break;
}
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /media/50x.html;
}
参考网站(http://gunicorn.org/, )
在windows下通过源码安装gunicorn报错 缺少fcntl模块 最好在linux环境下使用
首先安装gunicorn 和django
gunicorn_django -D -b 127.0.0.1:8000
然后配下nginx
server {
listen 80;
server_name 域名;
root django项目目录 ;
location /static/ {
if ($query_string) {
expires max;
# log_not_found off;
}
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:8000;
break;
}
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /media/50x.html;
}
参考网站(http://gunicorn.org/, )
相关文章推荐
- Django+nginx+gunicorn部署流程(二)
- Nginx+Gunicorn+virtualenv+supervisord+Postgresql部署Django应用 推荐
- 在nginx上部署django项目--------Gunicorn+Django+nginx+mysql
- 【Python】Centos7下部署Django(nginx+gunicorn)
- 初次部署django+gunicorn+nginx
- ubuntu/linux nginx+Gunicorn+django 部署方法详细教程
- 云服务器之nginx+gunicorn+django+mysql部署
- Nginx和Gunicorn部署Django
- python+django+gunicorn+nginx的配置
- 使用uwsgi+nginx运行django程序
- nginx+gunicorn+django
- virtualenv 环境下 Django + Nginx + Gunicorn+ Supervisor 搭建 Python Web
- windows环境下用nginx+FastCGI方式运行Django
- Nginx+Gunicorn+Supervisor 搭建 Django 项目环境
- CentOS6.8下Django项目运行坏境搭建-nginx(四)
- nginx+gunicorn+virtualenv部署django项目
- Django +nginx+gunicorn+阿里云部署笔记之git 与数据库迁移 +本地与服务器文件传输
- nginx+django+gunicorn+gevent+supervisor
- 阿里云部署Django项目(超详细图文教程) —— Part2. 使用Nginx, Gunicorn, virtualenv, supervisor 部署Django应用
- A Django setup using Nginx and Gunicorn