default.conf 690 B

123456789101112131415161718192021222324252627282930313233
  1. upstream django_project {
  2. server localhost:8000;
  3. }
  4. error_log /var/log/nginx/error.log;
  5. server {
  6. listen 8080;
  7. access_log /var/log/nginx/access.log;
  8. location / {
  9. proxy_pass http://django_project;
  10. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  11. proxy_set_header X-Real-IP $remote_addr;
  12. proxy_set_header Host $host;
  13. proxy_redirect off;
  14. client_max_body_size 100M;
  15. }
  16. location /static/ {
  17. alias /app/staticfiles/;
  18. }
  19. location /media/ {
  20. alias /app/mediafiles/;
  21. }
  22. error_page 500 502 503 504 /50x.html;
  23. location = /50x.html {
  24. root /usr/share/nginx/html;
  25. }
  26. }