Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. upstream intranet_app_server {
  2. #fail_timeout=0 means we always retry an upstream even if it failed
  3. #to return a good HTTP response (in case the Unicorn master nukes a
  4. #single worker for timing out).
  5.  
  6. server unix:/home/apps/run/gunicorn.sock fail_timeout=0;
  7. }
  8. server {
  9. listen 80;
  10. server_name 192.168.1.234;
  11. client_max_body_size 4G;
  12. access_log /home/apps/logs/nginx-access.log;
  13. error_log /home/apps/logs/nginx-error.log;
  14.  
  15. location /static/ {
  16. alias /home/apps/intranet/svgintranet/intranet/staticfiles/;
  17. }
  18.  
  19. location /media/ {
  20. alias /home/apps/intranet/svgintranet/intranet/media/;
  21. }
  22.  
  23. location / {
  24. # an HTTP header important enough to have its own Wikipedia entry:
  25. # http://en.wikipedia.org/wiki/X-Forwarded-For
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. # enable this if and only if you use HTTPS, this helps Rack
  28. # set the proper protocol for doing redirects:
  29. # proxy_set_header X-Forwarded-Proto https;
  30. # pass the Host: header from the client right along so redirects
  31. # can be set properly within the Rack application
  32. proxy_set_header Host $http_host;
  33. # we don't want nginx trying to do something clever with
  34. # redirects, we set the Host: header above already.
  35. proxy_redirect off;
  36. # set "proxy_buffering off" *only* for Rainbows! when doing
  37. # Comet/long-poll stuff. It's also safe to set if you're
  38. # using only serving fast clients with Unicorn + nginx.
  39. # Otherwise you _want_ nginx to buffer responses to slow
  40. # clients, really.
  41. # proxy_buffering off;
  42. # Try to serve static files from nginx, no point in making an
  43. # *application* server like Unicorn/Rainbows! serve static files.
  44. if (!-f $request_filename) {
  45. proxy_pass http://intranet_app_server;
  46. break;
  47. }
  48. }
  49. # Error pages
  50. error_page 500 502 503 504 /500.html;
  51. location = /error_404.html {
  52. root /home/apps/intranet/svgintranet/intranet/templates/errors/;
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement