Can you redirect remote access of PLEX Media Server to a reverse proxy with NGINX?

Server Version#: 1.21.4.4079

Good morning,
I would like to expose you a question about remote access, I need to expose PLEX through proxy reverse with NGINX on a virtual machine hosted on proxmox and close port 32400 on the modem/router to the virtual machine where the PLEX server is, how can I then tell it when do I remotely log in that PLEX must reach it on the other virtual machine? it can be done?

This should get you in the right direction. Some modification will be needed.
https://raw.githubusercontent.com/linuxserver/reverse-proxy-confs/master/plex.subdomain.conf.sample

thanks

i tried and it works, but how do i tell the server to fetch from the new ip instead of the ip of the machine where the server is located? because if I log in from the remote access page it always gives me the IP of the machine where the server is hosted and not the one where I have NGINX, I would like the machine with NGINX to act as an intermediary.

you need to actually pass on the IP
as far as i remember its
real_ip_header X-Real-IP;
proxy_set_header X-Real-IP $remote_addr;

some documentation i just found: Using the Forwarded header | NGINX

i am testing

Use this as reference. It’s what I’ve been building and extending on and has worked great so far.

I need the PLEX servers not to look for the IP of the server machine where PLEX is installed. but that they are directed to the server with NGINX, can it be done?
because I need to isolate all the machines on my network and keep only one that acts as an intermediary to the others.

the Plex server sees me simply the Windows machine (Plex Server) and not the Ubuntu machine (NGINX) that I want

LOL, I’d done that before.

Base on my understanding, the plex connected to the plex.tv server to register the IP which server located when it’s started. That’s why you always got the plex host IP instead of r-proxy’s.

That’s a trick I’m applying for all my plex servers:

  1. Setup a sock5 or something like that in the Nginx server.
  2. Using iptables to re-routing all OUTPUT to the Nginx server.
  3. Disable all the incoming IPs except nginx’s via iptables as well.

That will do the work.

So you need to install Plex on Linux instead of windows.

My bad, base on windows, just add the socks5 proxy in networking settings.

That’s what the “custom domains” is for, since plex can’t do what you’re asking for.

Deactivate remote access. Plex will always only see your nginx IP and use that as reference for “remote access”. The real-ip is in the header, which plex doesn’t care about and just logs.
Enter your custom domain / public IP in the network tab and the rest is nginx https->32400 local

on my nginx I have already exposed my home automation server on port 443 and port 80, but how can I also expose plex on port 32400 with nginx? of the type
home.domain.net:32400 or plex.domain.net

i can’t install plex on linux, i have optimizations that i can’t use on linux

So, just set up socks5 proxy on the Nginx server, that should work as well.

i am testing this setup, but it tells me it is unable to access plex.tv, how do i fix?

on my nginx I have already exposed my home automation server on port 443 and port 80

subdomains. just add another server { } block with the subdomain

there are too many points of failure. you gotta narrow it down.
can you access plex via plex.yourdomain or app.plex.tv/desktop ?
check logs in nginx and/or your firewall.
ping your system, is it getting through?
etc

i solved, but how do i use the mobile or desktop app with my domain (plex.domain.net)?

plex - Pastebin.com I solved it like this

if i want to access also from plex.tv how do i do?

I solved, some clients do not accept https to stream content and I had to remove the redirect from http to https.
Now I see everything perfectly even remotely having nginx doing it by, adding in the network settings custom URLs for accessing the server

https://plex.domain.net:443,http//plex.domain.net:80

this is the nginx server configuration to reverse proxy plex

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.