Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. # make sure that your dns has a cname set for plex, if plex is running in bridge mode, the below config should work as is, for host mode,
  2. # replace the line "proxy_pass http://$upstream_plex:32400;" with "proxy_pass http://HOSTIP:32400;" HOSTIP being the IP address of plex
  3. # in plex server settings, under network, fill in "Custom server access URLs" with your domain (ie. "https://plex.yourdomain.url:443")
  4.  
  5. server {
  6. listen 443 ssl;
  7. listen [::]:443 ssl;
  8.  
  9. server_name plex.sampledomain.com;
  10.  
  11. include /config/nginx/ssl.conf;
  12.  
  13. client_max_body_size 0;
  14. proxy_redirect off;
  15. proxy_buffering off;
  16.  
  17. # enable for ldap auth, fill in ldap details in ldap.conf
  18. #include /config/nginx/ldap.conf;
  19.  
  20.  
  21. location / {
  22. # enable the next two lines for http auth
  23. #auth_basic "Restricted";
  24. #auth_basic_user_file /config/nginx/.htpasswd;
  25.  
  26. # enable the next two lines for ldap auth
  27. #auth_request /auth;
  28. #error_page 401 =200 /login;
  29.  
  30. include /config/nginx/proxy.conf;
  31. resolver 127.0.0.11 valid=30s;
  32. set $upstream_plex binhex-plex;
  33. proxy_pass http://$upstream_plex:32400;
  34.  
  35. proxy_set_header Upgrade $http_upgrade;
  36. proxy_set_header Connection "upgrade";
  37.  
  38. proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
  39. proxy_set_header X-Plex-Device $http_x_plex_device;
  40. proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
  41. proxy_set_header X-Plex-Platform $http_x_plex_platform;
  42. proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
  43. proxy_set_header X-Plex-Product $http_x_plex_product;
  44. proxy_set_header X-Plex-Token $http_x_plex_token;
  45. proxy_set_header X-Plex-Version $http_x_plex_version;
  46. proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
  47. proxy_set_header X-Plex-Provides $http_x_plex_provides;
  48. proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
  49. proxy_set_header X-Plex-Model $http_x_plex_model;
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement