Advertisement
a_igin

Untitled

Nov 30th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. upstream django {
  2. server unix:/srv/project.sock;
  3. }
  4.  
  5. server {
  6. listen 3000;
  7. server_name project.host;
  8.  
  9. location / {
  10. proxy_pass http://django;
  11. proxy_set_header Host $http_host;
  12. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  13. proxy_set_header X-Forwarded-Protocol "";
  14. proxy_set_header X-Forwarded-Ssl "";
  15. }
  16.  
  17. location /static/ {
  18. autoindex on;
  19. alias /root/project_files/static/;
  20. }
  21. location /media/ {
  22. autoindex on;
  23. alias /root/project_files/media/;
  24. }
  25. # ssl
  26. listen 443 ssl http2;
  27. listen [::]:443 ssl http2;
  28. ssl on;
  29.  
  30. ssl_certificate /etc/letsencrypt/live/project.host/fullchain.pem;
  31. ssl_certificate_key /etc/letsencrypt/live/project.host/privkey.pem;
  32. ssl_session_tickets off;
  33.  
  34. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
  35.  
  36. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  37.  
  38. add_header Strict-Transport-Security "max-age=63072000" always;
  39.  
  40. ssl_stapling on;
  41. ssl_stapling_verify on;
  42.  
  43. ssl_trusted_certificate /etc/letsencrypt/live/project.host/fullchain.pem;
  44.  
  45. resolver 127.0.0.1;
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement