Remote access solved with NGINX Proxy Manager

I’ve had an installation running for a long time, but some network changes rendered it inaccessible from outside my network and I’ve been going through hell trying to figure out how to fix that.

I could connect directly with a browser, but the problem is when you connect with Roku or similar, it runs through plex.tv. I could turn on remote access in the server settings with a port forwarding rule but the connection would only last a few seconds before breaking off.

A lot of other people have had this problem, so here is my workaround.

It starts with installing NGINX Proxy Manager (NPM). I’m using the one that’s part of Home Assistant, but you could also install one with unRAID or similar. It’s very simple to install.

You’ll need your own domain which you can get inexpensively at namecheap. Then point a subdomain (e.g. plex.example.com) to your home IP (IIRC you can use a dynamic A record in case your IP changes). Then forward ports 443 and 80 in your router to your NPM machine. Do NOT forward port 32400 in your router.

In the Plex server, turn OFF Remote Access, then go to the Network section and enter this where it says Custom server access URLs: https://plex.example.com:443, http://plex.example.com:80

That tells plex.tv where to find your server, and now you should be able to connect via plex.tv with the dumbest of clients, e.g. roku.

Hope this helps someone. Cheers, Richard

5 Likes

Just tried this and worked perfectly, your a absolute legend! The best of all, its so easy if you have a Nginx proxy and your own domain.

1 Like

Thanks. I feel this will be far more robust than native Plex remote access. If anyone needs help with this, I could post screenshots for any step of the process. (When I use a lot of time to find a solution, I’m even more motivated to save that time for others.)

Hi @RichardU , please do. Always eager to see new ways of making things work.

To start you will have to have the following:
NGinx (reverse proxy) - working
Plex media server working with Remote Access - working
DDNS point to your home IP - up and running
Have a custom domain with a external DNS regsitra (GoDaddy or any other) point to your DDNS name (CNAME)
The ability to change your firewall rules

If so please let me know and Ill be happy to do the same

on the nginx what are you filling up?
i got a sub domain on a domain i already have and have it poiting to the right ip. opening up the subdomain does trigger the iOS plex app but the server is still offline on the app and browser. missing something on my end probably

@The_Wicked_One is the correct term or a typeo?

“on the nginx what are you filling up?”

Sorry @RichardU, hadn’t finished up writing the message :slight_smile:

Its got to go, sub.domain.com->firewall IP-> firewall rule to forward 80,443 to Nginx IP->NGinx destination domain (sub.domain.com)->internal IP of Plex on port 32400.

You should look at using DDNS and not the external Ip incase it changes.

Will give it a go after lunch and report back :slight_smile:
Thanks for taking the time to reply back @Silversurfer79

1 Like

Make sure you have an SSL for this domain

In NGINX Proxy Manager

image

@RichardU Any reason you have Websockets Support on?

will this break the PMS ability from seeing the source IP? aka does all the traffic look like it’s coming from the proxy?

I have my lan subnet as allowed without auth so if that’s the case that would be very, very bad

No not at all, all the info you see in the Dashboard is fine. All this does is allow people using your plex service to connect via your url (and SSL cert) instead of Plexes.

image

nice, I have some nginx proxies running certbot for other stuff (never seen that proxy manager that seems pretty nifty), might have to try this out

you don’t have to export the p12 file and put it in the plex:network settings or anything?

No, just read Richards comments above, Nginx takes care of the certs.

FYI, its Nginx Proxy Manager and not native Nginx that we are using.

Ya that’s fine, nginx proxy manager is just a nice GUI for setting up reverse proxies in nginx but I already have nginx running with certbot for various reverse proxies, just need to add another config and try it out

Is there a reason you used the regular http/https ports vs plex’s 32400?

Thats the default Plex listening port 32400. The entire point of a reverse proxy (ur choices 80 or 443) it changes the traffic, this is what makes it secure and safer.

You can put a reverse proxy on whatever port you wish, what makes it secure is going through the reverse proxy

In my installation, it doesn’t work without.