| @ -1,32 +1,37 @@ | |||
| upstream django_project { | |||
| server localhost:8000; | |||
| events { | |||
| } | |||
| error_log /var/log/nginx/error.log; | |||
| http { | |||
| upstream django_project { | |||
| server localhost:8000; | |||
| } | |||
| server { | |||
| listen 80; | |||
| error_log /var/log/nginx/error.log; | |||
| access_log /var/log/nginx/access.log; | |||
| server { | |||
| listen 80; | |||
| location / { | |||
| proxy_pass http://django_project; | |||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
| proxy_set_header Host $http_host; | |||
| proxy_redirect off; | |||
| client_max_body_size 100M; | |||
| } | |||
| access_log /var/log/nginx/access.log; | |||
| location /static/ { | |||
| alias /app/wsgi/static/; | |||
| } | |||
| location / { | |||
| proxy_pass http://django_project; | |||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |||
| proxy_set_header Host $http_host; | |||
| proxy_redirect off; | |||
| client_max_body_size 100M; | |||
| } | |||
| location /media/ { | |||
| alias /app/wsgi/mediafiles/; | |||
| } | |||
| location /static/ { | |||
| alias /app/wsgi/static/; | |||
| } | |||
| error_page 500 502 503 504 /50x.html; | |||
| location = /50x.html { | |||
| root /usr/share/nginx/html; | |||
| } | |||
| location /media/ { | |||
| alias /app/wsgi/mediafiles/; | |||
| } | |||
| error_page 500 502 503 504 /50x.html; | |||
| location = /50x.html { | |||
| root /usr/share/nginx/html; | |||
| } | |||
| } | |||
| } | |||