plex.subdomain.conf 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ## Version 2020/12/09
  2. # make sure that your dns has a cname set for plex
  3. # if plex is running in bridge mode and the container is named "plex", the below config should work as is
  4. # if not, replace the line "set $upstream_app plex;" with "set $upstream_app <containername>;"
  5. # or "set $upstream_app <HOSTIP>;" for host mode, HOSTIP being the IP address of plex
  6. # in plex server settings, under network, fill in "Custom server access URLs" with your domain (ie. "https://plex.yourdomain.url:443")
  7. server {
  8. listen 443 ssl;
  9. listen [::]:443 ssl;
  10. server_name plex.*;
  11. include /config/nginx/ssl.conf;
  12. client_max_body_size 0;
  13. proxy_redirect off;
  14. proxy_buffering off;
  15. # enable for ldap auth, fill in ldap details in ldap.conf
  16. #include /config/nginx/ldap.conf;
  17. # enable for Authelia
  18. #include /config/nginx/authelia-server.conf;
  19. location / {
  20. # enable the next two lines for http auth
  21. #auth_basic "Restricted";
  22. #auth_basic_user_file /config/nginx/.htpasswd;
  23. # enable the next two lines for ldap auth
  24. #auth_request /auth;
  25. #error_page 401 =200 /ldaplogin;
  26. # enable for Authelia
  27. #include /config/nginx/authelia-location.conf;
  28. include /config/nginx/proxy.conf;
  29. resolver 127.0.0.11 valid=30s;
  30. set $upstream_app plex;
  31. set $upstream_port 32400;
  32. set $upstream_proto http;
  33. proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  34. proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
  35. proxy_set_header X-Plex-Device $http_x_plex_device;
  36. proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
  37. proxy_set_header X-Plex-Platform $http_x_plex_platform;
  38. proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
  39. proxy_set_header X-Plex-Product $http_x_plex_product;
  40. proxy_set_header X-Plex-Token $http_x_plex_token;
  41. proxy_set_header X-Plex-Version $http_x_plex_version;
  42. proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
  43. proxy_set_header X-Plex-Provides $http_x_plex_provides;
  44. proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
  45. proxy_set_header X-Plex-Model $http_x_plex_model;
  46. }
  47. }