Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save grrowl/010d2892c7b16f2a0e5e40f83e671ca7 to your computer and use it in GitHub Desktop.
Save grrowl/010d2892c7b16f2a0e5e40f83e671ca7 to your computer and use it in GitHub Desktop.

Revisions

  1. @hazcod hazcod revised this gist Jan 4, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions apache-plex-reverse-proxy.vhost
    Original file line number Diff line number Diff line change
    @@ -44,6 +44,8 @@ ServerTokens Prod

    ProxyRequests Off
    ProxyPreserveHost On
    SSLProxyEngine On
    RequestHeader set Front-End-Https "On"
    ProxyPass / http://plex:32400/ #plex here is resolved to my plex container
    ProxyPassReverse / http://plex:32400/ #plex here is resolved to my plex container

  2. @hazcod hazcod revised this gist Jan 4, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion apache-plex-reverse-proxy.vhost
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ ServerTokens Prod
    Header always set X-Frame-Options DENY
    FileETag None
    TraceEnable off
    Header edit Set-Cookie ^(.*)$ ;HttpOnly;Secure
    #Header edit Set-Cookie ^(.*)$ ;HttpOnly;Secure
    Header set X-XSS-Protection "1; mode=block"
    Timeout 60

  3. @hazcod hazcod revised this gist Jan 4, 2016. No changes.
  4. @hazcod hazcod revised this gist Dec 29, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion apache-plex-reverse-proxy.vhost
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,7 @@ ServerTokens Prod
    ProxyPassReverse wss://plex:32400/:/websockets/notifications #plex here is resolved to my plex container
    </Location>

    <Proxy> *>
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
  5. @hazcod hazcod revised this gist Dec 29, 2015. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions apache-plex-reverse-proxy.vhost
    Original file line number Diff line number Diff line change
    @@ -41,8 +41,6 @@ ServerTokens Prod
    Order deny,allow
    Allow from all
    </Proxy>

    Header add X-Forwarded-Proto "https"

    ProxyRequests Off
    ProxyPreserveHost On
  6. @hazcod hazcod revised this gist Dec 29, 2015. No changes.
  7. @hazcod hazcod created this gist Dec 29, 2015.
    57 changes: 57 additions & 0 deletions apache-plex-reverse-proxy.vhost
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    ServerSignature Off
    ServerTokens Prod

    <VirtualHost *:80>
    ServerName plex.website.com
    # This VirtualHost redirects everything to HTTPS on port 443.
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    </VirtualHost>

    <VirtualHost *:443>
    ServerName plex.website.com
    ServerAlias ""
    Options -Includes -ExecCGI

    RewriteEngine On
    RewriteCond %{THE_REQUEST} !HTTP/1.1$
    RewriteRule .* - [F]

    LimitRequestBody 512000
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/cert.pem
    SSLCertificateKeyFile /etc/apache2/ssl/privkey.pem
    SSLProtocol +TLSv1.2

    Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
    Header always set X-Frame-Options DENY
    FileETag None
    TraceEnable off
    Header edit Set-Cookie ^(.*)$ ;HttpOnly;Secure
    Header set X-XSS-Protection "1; mode=block"
    Timeout 60

    <Location /:/websockets/notifications>
    ProxyPass wss://plex:32400/:/websockets/notifications #plex here is resolved to my plex container
    ProxyPassReverse wss://plex:32400/:/websockets/notifications #plex here is resolved to my plex container
    </Location>

    <Proxy> *>
    Order deny,allow
    Allow from all
    </Proxy>

    Header add X-Forwarded-Proto "https"

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass / http://plex:32400/ #plex here is resolved to my plex container
    ProxyPassReverse / http://plex:32400/ #plex here is resolved to my plex container

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/web
    RewriteCond %{HTTP:X-Plex-Device} ^$
    RewriteCond %{REQUEST_METHOD} !^(OPTIONS)$
    RewriteRule ^/$ /web/$1 [R,L]
    </VirtualHost>