Lets Encrypt Plex Not Found via domain

Hi Ive installed Lets Encrpt and when I go to the plex tab in the Quickbox dashboard through my domain name I get a Not Found message followed by The requested URL /web/ was not found on this server.
Apache/2.4.18 (Ubuntu) Server at my.domain.com Port 443
If I use the ip address to access the dashboard and select Plex it works fine.
Also if I use my.domain.com:31400/web/index.html I get Not Found but if I use my.domain.com:32400/web/index.html plex works but is unsecure.
I have another server with Quickbox installed and it runs perfectly with my other domain.

Since 31400 is nothing more than a proxy this is expected. This is just acting as a forwarding agent and not an access point. 32400 is the actual port and trying to connect to 32400 via https will fail due to secure ports being read on 443 (unless otherwise provisioned by the software).

What you could do is essentially the best method in my opinion, and that is to place plex vhosts on a subdomain.

Here’s the vhosts config that you can place in your plex.conf file - remember to backup your original configuration first before making any changes. Additionally, you will need to install Let’s Encrypt on the subdomain as well.

(please modify it to fit your domain needs by only changing the YOURSUB.DOMAIN.COM variables)

ServerSignature Off
ServerTokens Prod

<VirtualHost *:80>
  ServerName YOURSUB.DOMAIN.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 YOURSUB.DOMAIN.COM
  ServerAlias ""
  Options -Includes -ExecCGI

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

  LimitRequestBody 512000
  SSLEngine On
  SSLCertificateFile /etc/letsencrypt/live/YOURSUB.DOMAIN.COM/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/YOURSUB.DOMAIN.COM/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://localhost:32400/:/websockets/notifications
        ProxyPassReverse wss://localhost:32400/:/websockets/notifications
    </Location>

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

    ProxyRequests Off
    ProxyPreserveHost On
    SSLProxyEngine On
    RequestHeader set Front-End-Https "On"
    ProxyPass / http://localhost:32400/
    ProxyPassReverse / http://localhost:32400/

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

Thanks for the quick reply. Donated $20.
You guys are awesome.

1 Like

Hey, I did not manage to get the plex.conf working. My subdomain always redirects me to the Quickbox Dashboard. What am I doing wrong?

Just to be accurate: I just have to edit the plex.conf in the way it is posted above, correct?

Regards

unn4m3d