mirror of
https://github.com/BillyOutlast/drop-cdn.git
synced 2026-02-04 02:51:20 +01:00
90 lines
3.3 KiB
Plaintext
90 lines
3.3 KiB
Plaintext
# This file only goes on the machine running plex
|
|
|
|
upstream plex {
|
|
server 127.0.0.1:32400; # Change this to where plex is running
|
|
keepalive 32;
|
|
}
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
# Define Server Domain
|
|
server_name srv1.example.com;
|
|
|
|
ssl_certificate /etc/nginx/ssl/example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/example.com/key.pem;
|
|
include snippets/ssl-params.conf;
|
|
send_timeout 100m;
|
|
client_max_body_size 0;
|
|
proxy_headers_hash_bucket_size 128;
|
|
proxy_headers_hash_max_size 1024;
|
|
proxy_buffers 128 4k;
|
|
|
|
access_log off;
|
|
|
|
location / {
|
|
proxy_redirect off;
|
|
proxy_buffering off;
|
|
# Sockets
|
|
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
|
|
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
|
|
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
|
|
# Plex Headers
|
|
proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
|
|
proxy_set_header X-Plex-Container-Size $http_x_plex_container_size;
|
|
proxy_set_header X-Plex-Container-Start $http_x_plex_container_start;
|
|
proxy_set_header X-Plex-Device $http_x_plex_device;
|
|
proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
|
|
proxy_set_header X-Plex-Platform $http_x_plex_platform;
|
|
proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
|
|
proxy_set_header X-Plex-Product $http_x_plex_product;
|
|
proxy_set_header X-Plex-Token $http_x_plex_token;
|
|
proxy_set_header X-Plex-Version $http_x_plex_version;
|
|
proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
|
|
proxy_set_header X-Plex-Provides $http_x_plex_provides;
|
|
proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
|
|
proxy_set_header X-Plex-Model $http_x_plex_model;
|
|
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 X-Forwarded-Proto $scheme;
|
|
# Allows All Encodings
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_ssl_verify off;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
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 X-Forwarded-Proto $scheme;
|
|
proxy_read_timeout 86400;
|
|
proxy_pass https://plex;
|
|
}
|
|
|
|
location /tautulli {
|
|
include /etc/nginx/snippets/proxy.conf;
|
|
proxy_pass http://127.0.0.1:8181/tautulli;
|
|
}
|
|
|
|
location /librespeed {
|
|
alias /srv/librespeed;
|
|
client_max_body_size 50M;
|
|
client_body_buffer_size 128k;
|
|
|
|
location ~ \.php$ {
|
|
include snippets/fastcgi-php.conf;
|
|
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
include fastcgi_params;
|
|
}
|
|
}
|
|
}
|