worker_processes auto; events { worker_connections 1024; } http { upstream plexmediaserver { server localhost:32400; keepalive 32; } server { listen plex.stashbox:80; resolver resolver.stashbox; server_name plex.*; 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]\."; proxy_set_header Host $host; proxy_set_header Referer localhost; proxy_set_header Origin $scheme://localhost:$server_port; 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_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; proxy_set_header Accept-Encoding ""; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_redirect off; proxy_buffering off; location / { proxy_pass http://plexmediaserver; } } }