Remote Plex Server

(b2c) #1

My Plex server is hosted in a remote machine which can be only visited from my caddy server machine IP. I want to make it accessible from the internet using the caddy proxy.

Plex Server Web Interface : http://[ REMOTE PLEX IP ]:32400/web/index.html

proxy /  [REMOTE PLEX IP]:32400 {
	header_downstream -Server
}

So I can browse PLEX web interface using my http://[ Caddy Server IP ]:32400/web/index.html, then it forwards to https://app.plex.tv/auth/*** for login. Login also works and after login, it comes back to my caddy server IP. Then web interface looks for nearby plex server, and find nothing. I believe it happens because web interface is searching original IP of the plex server.

https://[REMOTE PLEX IP].[some random characters].plex.direct:32400/

Is there any way to solve it?

(Matthew Fay) #2

Try adding transparent to your proxy block? Maybe if Plex knows the hostname used to connect to it, it’ll fix the redirection from plex.tv.

(b2c) #3

Yes, it works! Is there any way to put it like this:

/plex

instead of

/

I tried with or without

without /plex

When I browse ip/plex it shows 404 from upstream. Web Interface is looking for img/css in the root.

(Matthew Fay) #4

It’s possible, yes.

My strong advice is not to try it, though. Plex does not like being put in a subfolder, it’s about as subfolder-hostile as I’ve ever seen an app. Use a subdomain instead and save yourself a lot of headache.

If you’re a glutton for punishment, you’ll want to look into http.filter and regex proxy upstream header rewriting. You need to manually rewrite all the redirects and HTML tags so that they point to the right subfolder.

1 Like