Skip to content

Instantly share code, notes, and snippets.

@dirtycajunrice
Last active July 14, 2022 14:35
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dirtycajunrice/9ea094052980f00d716f17366ac170bf to your computer and use it in GitHub Desktop.
Save dirtycajunrice/9ea094052980f00d716f17366ac170bf to your computer and use it in GitHub Desktop.
Plex-Apache-Reverse-Proxy
# requires a2enmod proxy proxy_http proxy_wstunnel rewrite ssl
<VirtualHost *:80>
ServerName plex.domain.tld
ServerAlias plex.domain2.tld
Redirect / https://plex.domain.tld
</VirtualHost>
<VirtualHost *:443>
ServerName plex.domain.tld
ServerAlias plex.domain2.tld
ServerAdmin nicholas.totsch@gmail.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:32400/
ProxyPassReverse / http://127.0.0.1:32400/
ProxyPass /:/websockets/notifications wss://127.0.0.1:32400/:/websockets/notifications
ProxyPassReverse /:/websockets/notifications wss://127.0.0.1:32400/:/websockets/notifications
RewriteCond %{HTTP_HOST} !^plex\.domain\.tld$ [NC]
RewriteRule ^/$ http://%{HTTP_HOST}/ [L,R=301]
ErrorLog ${APACHE_LOG_DIR}/plex.error.log
CustomLog ${APACHE_LOG_DIR}/plex.access.log combined
SSLCertificateFile /var/www/ssl_keys/mycert.crt
SSLCertificateKeyFile /var/www/ssl_keys/mykey.key
SSLCertificateChainFile /var/www/ssl_keys/intermediate.crt
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment