Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 444 ssl http2;
- listen [::]:444 ssl http2;
- server_name <domain>.co.uk;
- # SSL
- ssl_certificate /etc/letsencrypt/live/<domain>.co.uk/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/<domain>.co.uk/privkey.pem; # managed by Certbot
- # Disables compression between Plex and Nginx, required if using sub_filter below.
- # May also improve loading time by a very marginal amount, as nginx will compress anyway.
- #proxy_set_header Accept-Encoding "";
- # Buffering off send to the client as soon as the data is received from Plex.
- proxy_redirect off;
- proxy_buffering off;
- # gzip source: https://github.com/toomuchio/plex-nginx-reverseproxy/blob/master/nginx.conf
- gzip on;
- gzip_vary on;
- gzip_min_length 1000;
- gzip_proxied any;
- gzip_types text/plain text/css text/xml application/xml text/javascript application/x-javascript image/svg+xml;
- gzip_disable "MSIE [1-6]\.";
- # security headers
- add_header X-Frame-Options "SAMEORIGIN" always;
- add_header X-XSS-Protection "1; mode=block" always;
- add_header X-Content-Type-Options "nosniff" always;
- add_header Referrer-Policy "no-referrer-when-downgrade" always;
- # . files
- location ~ /\.(?!well-known) {
- deny all;
- }
- # logging
- access_log /var/log/nginx/plex-dmz.access.log;
- error_log /var/log/nginx/plex-dmz.error.log warn;
- location / {
- limit_except GET HEAD POST PUT OPTIONS { deny all; }
- proxy_pass http://192.168.166.28:32400;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $http_connection;
- proxy_set_header X-AMP-Scheme $scheme;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header X-Forwarded-Host $host;
- proxy_set_header X-Forwarded-Server $host;
- proxy_read_timeout 86400s;
- proxy_send_timeout 86400s;
- proxy_http_version 1.1;
- proxy_redirect off;
- proxy_buffering off;
- client_max_body_size 10240M;
- send_timeout 100m;
- # The following nine lines will only work if nginx and AMP are on the same host
- error_page 502 /NotRunning.html;
- location = /NotRunning.html {
- limit_except GET { deny all; }
- root /var/www/amp.<domain>.co.uk/html;
- internal;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement