Skip to content

Instantly share code, notes, and snippets.

@cosven cosven/nginx.conf
Last active Aug 22, 2018

What would you like to do?
Django 项目部署示例
server {
listen 80;
# 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;
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

This comment has been minimized.

Copy link
Owner Author

cosven commented Aug 22, 2018

  1. nginx.conf 是 Nginx 配置文件(一般放到 nginx 的 sites-enabled/ 目录下)
  2. web.conf 是进程的 supervisor 配置文件()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.