a_igin

Untitled

Oct 21st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. upstream backend {
  2. server unix:/srv/domain.sock;
  3. }
  4.  
  5. server {
  6. listen 80;
  7.  
  8. server_name domain.com;
  9. proxy_read_timeout 60;
  10.  
  11. client_max_body_size 20m;
  12.  
  13. location /static/ {
  14. access_log /root/log/nginx-static-access.log;
  15. error_log /root/log/nginx-static-error.log;
  16. alias /root/files/static/;
  17. }
  18.  
  19. location /media/ {
  20. access_log /root/log/nginx-media-access.log;
  21. error_log /root/log/nginx-media-error.log;
  22. alias /root/files/media/;
  23. }
  24.  
  25. location / {
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. proxy_set_header Host $host;
  28. proxy_redirect off;
  29.  
  30. proxy_pass https://backend;
  31. }
  32. }
  33.  
  34. server {
  35. listen 443 ssl http2;
  36. listen [::]:443 ssl http2;
  37. ssl on;
  38.  
  39. ssl_certificate /etc/ssl/domain.crt;
  40. ssl_certificate_key /etc/ssl/domain.key;
  41. ssl_session_timeout 10m;
  42. ssl_session_cache shared:SSL:10m;
  43. ssl_session_tickets off;
  44.  
  45. ssl_dhparam /etc/ssl/domain_dhparams.pem;
  46.  
  47. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  48.  
  49. add_header Strict-Transport-Security "max-age=63072000" always;
  50.  
  51. ssl_stapling on;
  52. ssl_stapling_verify on;
  53.  
  54. ssl_trusted_certificate /etc/ssl/ca_plus_intermediate.crt;
  55.  
  56. resolver 127.0.0.1;
  57. }
Add Comment
Please, Sign In to add comment