Last active
August 22, 2018 13:56
-
-
Save cosven/e308359b83df5cbbe7398b4a95247add to your computer and use it in GitHub Desktop.
Django 项目部署示例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name cosven.me www.cosven.me; | |
# path for static files | |
location /static/ { | |
root /data/static; | |
} | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
try_files $uri @proxy_to_app; | |
} | |
location @proxy_to_app { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://0.0.0.0:8000; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:web] | |
command = /data/venvs/web/bin/gunicorn -b :8000 -w 4 web.wsgi --log-file - | |
directory = /data/xxx | |
environment = DEBUG="1",NAME="2" | |
autostart = true | |
autorestart = true | |
loglevel = info | |
stdout_logfile = /data/log/supervisor/web-stdout.log | |
stderr_logfile = /data/log/supervisor/web-stderr.log | |
stdout_logfile_maxbytes = 500MB | |
stdout_logfile_backups = 50 | |
stdout_capture_maxbytes = 1MB | |
stdout_events_enabled = false |
Author
cosven
commented
Aug 22, 2018
- nginx.conf 是 Nginx 配置文件(一般放到 nginx 的 sites-enabled/ 目录下)
- web.conf 是进程的 supervisor 配置文件()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment