Guest User

Untitled

a guest
Dec 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. 2017/12/18 16:30:06 [crit] 27927#27927: *25 connect() to unix:/webapps/theband/run/gunicorn.sock failed (2: No such fil$/ HTTP/1.1", upstream: "http://unix:/webapps/theband/run/gunicorn.sock:/", host: "207.154.232.99"
  2.  
  3. from django.conf.urls import include, url, handler404, handler500
  4. from .views import error_404, error_500 -- into views was that {
  5.  
  6. from django.shortcuts import render
  7. def error_404(request):
  8. return render(request,'error_404.html')
  9. def error_500(request):
  10. return render(request,'error_500.html')
  11. }
  12. also in urls.py was this:
  13. handler404 = error_404
  14. handler500 = error_500
  15.  
  16. upstream theband {
  17. # fail_timeout=0 means we always retry an upstream even if it failed
  18. # to return a good HTTP response (in case the Unicorn master nukes a
  19. # single worker for timing out).
  20.  
  21. server unix:/webapps/theband/run/gunicorn.sock fail_timeout=0;
  22. }
  23.  
  24. server {
  25.  
  26. listen 80;
  27. server_name 207.154.232.99;
  28. client_max_body_size 4G;
  29.  
  30. access_log /webapps/theband/logs/nginx-access.log;
  31. error_log /webapps/theband/logs/nginx-error.log;
  32.  
  33. location /static/ {
  34. alias /webapps/theband/static/;
  35. }
  36.  
  37. location /media/ {
  38. alias /webapps/theband/media/;
  39. }
  40. location / {
  41. # an HTTP header important enough to have its own Wikipedia entry:
  42. # http://en.wikipedia.org/wiki/X-Forwarded-For
  43. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  44.  
  45. # enable this if and only if you use HTTPS, this helps Rack
  46. # set the proper protocol for doing redirects:
  47. # proxy_set_header X-Forwarded-Proto https;
  48.  
  49. # pass the Host: header from the client right along so redirects
  50. # can be set properly within the Rack application
  51. proxy_set_header Host $http_host;
  52.  
  53. # we don't want nginx trying to do something clever with
  54. # redirects, we set the Host: header above already.
  55. proxy_redirect off;
  56.  
  57. # set "proxy_buffering off" *only* for Rainbows! when doing
  58. # Comet/long-poll stuff. It's also safe to set if you're
  59. # using only serving fast clients with Unicorn + nginx.
  60. # Otherwise you _want_ nginx to buffer responses to slow
  61. # clients, really.
  62. # proxy_buffering off;
  63. # we don't want nginx trying to do something clever with
  64. # redirects, we set the Host: header above already.
  65. proxy_redirect off;
  66.  
  67. # set "proxy_buffering off" *only* for Rainbows! when doing
  68. # Comet/long-poll stuff. It's also safe to set if you're
  69. # using only serving fast clients with Unicorn + nginx.
  70. # Otherwise you _want_ nginx to buffer responses to slow
  71. # clients, really.
  72. # proxy_buffering off;
  73.  
  74. # Try to serve static files from nginx, no point in making an
  75. # *application* server like Unicorn/Rainbows! serve static files.
  76. if (!-f $request_filename) {
  77. proxy_pass http://theband;
  78. break;
  79. }
  80. }
  81. error_page 404 /error_404.html;
  82. location = /error_404.html {
  83. root /webapps/theband/src/templates;
  84. }
  85.  
  86. # Error pages
  87. error_page 500 502 503 504 /error_500.html;
  88. location = /error_500.html {
  89. root /webapps/theband/src/templates;
  90. }
  91. }
Add Comment
Please, Sign In to add comment