环境
django == 1.11.16 nginx == 1.10.3项目编写
- 略
安装nginx
- 略(前一篇有详细介绍)
配置uwsgi
创建 xxx.ini 文件
[uwsgi]socket=:9000 # 端口chdir=/mnt/project/project_api # 项目路径 包含manage.py的路径module=pro.wsgi #pro为包含wsgi.py文件的文件名master=trueprocesses=4vacuum=true
配置nginx
vim /etc/nginx/nginx.confnginx.conf文件http{}中添加一个server
server { listen 80; server_name 域名 或者 localhost; charset UTF-8; access_log /var/log/nginx/djangohost.access.log; error_log /var/log/nginx/djangohost.error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9000; uwsgi_read_timeout 2; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }}重启nginx
ps -ef | grep nginxkill -HUP < pid ># 或者使用 serviceservice nginx restart启动项目
继续阅读与本文标签相同的文章
上一篇 :
这是阿里史上规模最大的五年陈授戒仪式
下一篇 :
在阿里做双职工是怎样的体验
-
每个阿里汉子心底,都有最柔软的地方
2026-05-23栏目: 教程
-
精心整理了15道面试官喜欢问的MyBatis面试题
2026-05-23栏目: 教程
-
交易撮合引擎:原理与实现
2026-05-23栏目: 教程
-
nginx的安装和配置
2026-05-23栏目: 教程
-
一位 iOS 大牛的 BAT面试心得与经验总结,送给正在迷茫 的你!
2026-05-23栏目: 教程
