Advertisement
Guest User

Untitled

a guest
Mar 27th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1.  
  2. server {
  3. listen 444 ssl http2;
  4. listen [::]:444 ssl http2;
  5.  
  6. server_name <domain>.co.uk;
  7.  
  8. # SSL
  9. ssl_certificate /etc/letsencrypt/live/<domain>.co.uk/fullchain.pem; # managed by Certbot
  10. ssl_certificate_key /etc/letsencrypt/live/<domain>.co.uk/privkey.pem; # managed by Certbot
  11.  
  12. # Disables compression between Plex and Nginx, required if using sub_filter below.
  13. # May also improve loading time by a very marginal amount, as nginx will compress anyway.
  14. #proxy_set_header Accept-Encoding "";
  15.  
  16. # Buffering off send to the client as soon as the data is received from Plex.
  17. proxy_redirect off;
  18. proxy_buffering off;
  19.  
  20. # gzip source: https://github.com/toomuchio/plex-nginx-reverseproxy/blob/master/nginx.conf
  21. gzip on;
  22. gzip_vary on;
  23. gzip_min_length 1000;
  24. gzip_proxied any;
  25. gzip_types text/plain text/css text/xml application/xml text/javascript application/x-javascript image/svg+xml;
  26. gzip_disable "MSIE [1-6]\.";
  27.  
  28. # security headers
  29. add_header X-Frame-Options "SAMEORIGIN" always;
  30. add_header X-XSS-Protection "1; mode=block" always;
  31. add_header X-Content-Type-Options "nosniff" always;
  32. add_header Referrer-Policy "no-referrer-when-downgrade" always;
  33.  
  34. # . files
  35. location ~ /\.(?!well-known) {
  36. deny all;
  37. }
  38.  
  39.  
  40. # logging
  41. access_log /var/log/nginx/plex-dmz.access.log;
  42. error_log /var/log/nginx/plex-dmz.error.log warn;
  43.  
  44. location / {
  45. limit_except GET HEAD POST PUT OPTIONS { deny all; }
  46. proxy_pass http://192.168.166.28:32400;
  47. proxy_set_header Host $host;
  48. proxy_set_header X-Real-IP $remote_addr;
  49. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  50. proxy_set_header Upgrade $http_upgrade;
  51. proxy_set_header Connection $http_connection;
  52. proxy_set_header X-AMP-Scheme $scheme;
  53. proxy_set_header X-Forwarded-Proto $scheme;
  54. proxy_set_header X-Forwarded-Host $host;
  55. proxy_set_header X-Forwarded-Server $host;
  56. proxy_read_timeout 86400s;
  57. proxy_send_timeout 86400s;
  58. proxy_http_version 1.1;
  59. proxy_redirect off;
  60. proxy_buffering off;
  61. client_max_body_size 10240M;
  62. send_timeout 100m;
  63. # The following nine lines will only work if nginx and AMP are on the same host
  64. error_page 502 /NotRunning.html;
  65. location = /NotRunning.html {
  66. limit_except GET { deny all; }
  67. root /var/www/amp.<domain>.co.uk/html;
  68. internal;
  69. }
  70.  
  71. }
  72. }
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement