Plex PMS behind Reverse Proxy possible?

Hi

Does anyone have a successful PLEX installation running and available remotely behind a reverse proxy?

I have been trying to get PLEX PMS working behind my Reverse SSL HAproxy ever since v1.1 came out. It worked beautifully in v1.0 but now it won’t complete the “enable remote access” proces which means it doesn’t register my external IP for server discovery.

My reverse proxy works fine if I access it directly with either the Web Client or the Windows Universal Plex Client so the setup is done right. But the IOS client is not happy since it seems to want a discovery URL published specifically marked for non-local.

Does anyone have an idea about how to get the plex “Enable Remote Access” proces to complete using a reverse proxy?
(I know what I’m doing and it’s not a firewall or portnumber mixup issue - like i wrote, the Web Client and Windows Client works through the proxy)

A search of the forums provides this as a working example. https://forums.plex.tv/discussion/200472/working-apache-reverse-proxy-configuration-for-plex

Might I suggest searching through the threads and asking in those threads? Maybe those users have improved since those posts?

@ChuckPa said:
A search of the forums provides this as a working example. https://forums.plex.tv/discussion/200472/working-apache-reverse-proxy-configuration-for-plex

Might I suggest searching through the threads and asking in those threads? Maybe those users have improved since those posts?

Yes, that was my initial thought as well, but i could not find any recent threads using v1.1 or newer (where the problem became a reality for me - it worked in previous versions).

So I thought i’d ask in general if anyone has got it working with current versions of the server.

Sorry about the bump…

No one at all running behind a reverse proxy?
Did you want to, but could’t get it working?

@DerKeyser said:
Sorry about the bump…

No one at all running behind a reverse proxy?
Did you want to, but could’t get it working?

I am, I use apache as a reverse proxy.

http://www.michons.us/2015/12/08/plex-web-interface-redirection/

@starbetrayer said:

@DerKeyser said:
Sorry about the bump…

No one at all running behind a reverse proxy?
Did you want to, but could’t get it working?

I am, I use apache as a reverse proxy.

http://www.michons.us/2015/12/08/plex-web-interface-redirection/

Hmm well that’s kinda good news. Suppose that means it is possible even though you are not using HTTPS. Are you running PMS v1.2 or later and have you tries IOS clients on your setup? Like I said, mine used to work on older versions.

The odd thing is, That’s a very very simple configuration, so I just don’t get it why HAproxy doesn’t work in my setup. Maybe there’s something HTTP only going on that misbehaves when reverse proxy’ing from HTTPS to HTTP?

@DerKeyser said:

@starbetrayer said:

@DerKeyser said:
Sorry about the bump…

No one at all running behind a reverse proxy?
Did you want to, but could’t get it working?

I am, I use apache as a reverse proxy.

http://www.michons.us/2015/12/08/plex-web-interface-redirection/

Hmm well that’s kinda good news. Suppose that means it is possible even though you are not using HTTPS. Are you running PMS v1.2 or later and have you tries IOS clients on your setup? Like I said, mine used to work on older versions.

The odd thing is, That’s a very very simple configuration, so I just don’t get it why HAproxy doesn’t work in my setup. Maybe there’s something HTTP only going on that misbehaves when reverse proxy’ing from HTTPS to HTTP?

I chose not to do a redirection with HTTPS because of the mess of certificate in my particular configuration.
That being said, my http link is protected via a httpasswd file and login.
You absolutely need to do this not to open your server to the world (showing the remote lan possiblity on the web)

I use the latest version of PMS.

My ios client (on my phone) does not connect via the reverse proxy though, and connect directly to port 32400.
My understanding is that you want your IOS client to connect to your reverse proxy as well, correct ?

I have never dealt with HAproxy and cannot be of help there.

@starbetrayer said:

@DerKeyser said:

@starbetrayer said:

@DerKeyser said:
Sorry about the bump…

No one at all running behind a reverse proxy?
Did you want to, but could’t get it working?

I am, I use apache as a reverse proxy.

http://www.michons.us/2015/12/08/plex-web-interface-redirection/

Hmm well that’s kinda good news. Suppose that means it is possible even though you are not using HTTPS. Are you running PMS v1.2 or later and have you tries IOS clients on your setup? Like I said, mine used to work on older versions.

The odd thing is, That’s a very very simple configuration, so I just don’t get it why HAproxy doesn’t work in my setup. Maybe there’s something HTTP only going on that misbehaves when reverse proxy’ing from HTTPS to HTTP?

I chose not to do a redirection with HTTPS because of the mess of certificate in my particular configuration.
That being said, my http link is protected via a httpasswd file and login.
You absolutely need to do this not to open your server to the world (showing the remote lan possiblity on the web)

I use the latest version of PMS.

My ios client (on my phone) does not connect via the reverse proxy though, and connect directly to port 32400.
My understanding is that you want your IOS client to connect to your reverse proxy as well, correct ?

I have never dealt with HAproxy and cannot be of help there.

Okay, that explains the differences between our setup. I use my plex mainly from remote locations and using both the windows and IOS app. So I need the remote access feature to work as designed (using the proxy).
The webapp works perfectly over the HTTPS to HTTP proxy when accessed directly. I can however not get the “enable remote access” wizard to complete using the proxied connection, but from what i understand of your usage, you only access your plex via the Webapp and going directly to you IP. So you never published your plex for remote access using the settings in the server webapp - is that correct?
And your IOS access is only internal since it’s in 32400 right?

So in the end your reverse proxy does not reveal if any of the things I can’t get to work actually does work on a reverse proxy.

But thank you very much for helping out :slight_smile: Have a nice holiday season.

@DerKeyser said:

@starbetrayer said:

@DerKeyser said:

@starbetrayer said:

@DerKeyser said:
Sorry about the bump…

No one at all running behind a reverse proxy?
Did you want to, but could’t get it working?

I am, I use apache as a reverse proxy.

http://www.michons.us/2015/12/08/plex-web-interface-redirection/

Hmm well that’s kinda good news. Suppose that means it is possible even though you are not using HTTPS. Are you running PMS v1.2 or later and have you tries IOS clients on your setup? Like I said, mine used to work on older versions.

The odd thing is, That’s a very very simple configuration, so I just don’t get it why HAproxy doesn’t work in my setup. Maybe there’s something HTTP only going on that misbehaves when reverse proxy’ing from HTTPS to HTTP?

I chose not to do a redirection with HTTPS because of the mess of certificate in my particular configuration.
That being said, my http link is protected via a httpasswd file and login.
You absolutely need to do this not to open your server to the world (showing the remote lan possiblity on the web)

I use the latest version of PMS.

My ios client (on my phone) does not connect via the reverse proxy though, and connect directly to port 32400.
My understanding is that you want your IOS client to connect to your reverse proxy as well, correct ?

I have never dealt with HAproxy and cannot be of help there.

Okay, that explains the differences between our setup. I use my plex mainly from remote locations and using both the windows and IOS app. So I need the remote access feature to work as designed (using the proxy).
The webapp works perfectly over the HTTPS to HTTP proxy when accessed directly. I can however not get the “enable remote access” wizard to complete using the proxied connection, but from what i understand of your usage, you only access your plex via the Webapp and going directly to you IP. So you never published your plex for remote access using the settings in the server webapp - is that correct?
And your IOS access is only internal since it’s in 32400 right?

So in the end your reverse proxy does not reveal if any of the things I can’t get to work actually does work on a reverse proxy.

But thank you very much for helping out :slight_smile: Have a nice holiday season.

that’s partially correct, i have the remote access enabled via port redirection of port 32400.
I could log on to plex.tv and remote access this way but it is blocked at work.
I wanted a way to access the admin area and the reverse proxy does it for me.

My IOS is external and connects through external ip:32400.
This is probably why you have difficulties.

Does your IOS app automatically discover your server using your plex account, or have you manually entered the servername/port to connect to?

I’m a little perplexed by your 32400 port redirect in parallel with your reverse proxy. Where’s the security in that (you say you require auhentication in your reverse proxy, yet you expose your PLEX directly on 32400 also)?
You are aware that using http://yourpublicIP:32400/web will grant access to your plex just like passing through your reverse proxy does, right?

But yes: My quest is to get ALL external access working through the reverse proxy. But right now I can’t - probably due to the “setup remote access” wizard not completing and thus not registering my external IP and port 443 for remote access :frowning:
Webaccess and the Windows native APP works great through the reverse proxy, but the IOS app fails to discover and access the server.

It automatically discovers it.

The reverse proxy is a way for me to access the admin area when I am away (I could do it other ways as well), as well as watching stuff through the web interface.

I publish my plex server at 32400 via port redirection, but if you connect to http://yourpublicip:32400/web/, but if i remember correctly, it still ask for your plex username and password (not open to the world).

My guess is that the IOS app requires you to publish the server to access it like you are experiencing.

This is what i use for Plex on ngin

 location /plex/ {
      proxy_pass http://192.168.1.43:32400/web/;
      proxy_buffering off;
      proxy_http_version 1.1;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $http_connection;
      proxy_cookie_path /web/ /plex/;
      auth_basic "Restricted";
      auth_basic_user_file /etc/nginx/.htpasswd;


 }

works just fine, this puts plex for me on this domain. https://domain.gtlx/plex

@Night said:
This is what i use for Plex on ngin

 location /plex/ {
      proxy_pass http://192.168.1.43:32400/web/;
      proxy_buffering off;
      proxy_http_version 1.1;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $http_connection;
      proxy_cookie_path /web/ /plex/;
      auth_basic "Restricted";
      auth_basic_user_file /etc/nginx/.htpasswd;


 }

works just fine, this puts plex for me on this domain. https://domain.gtlx/plex

Yes, but he webclient works correctly over my proxy as well. It’s the published access and specifically the IOS client that I want to run over the proxy. That probably doesn’t work in your setup (unless you have allowed the original URL as well (and non HTTPS))

@DerKeyser said:

@Night said:
This is what i use for Plex on ngin

 location /plex/ {
      proxy_pass http://192.168.1.43:32400/web/;
      proxy_buffering off;
      proxy_http_version 1.1;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $http_connection;
      proxy_cookie_path /web/ /plex/;
      auth_basic "Restricted";
      auth_basic_user_file /etc/nginx/.htpasswd;


 }

works just fine, this puts plex for me on this domain. https://domain.gtlx/plex

Yes, but he webclient works correctly over my proxy as well. It’s the published access and specifically the IOS client that I want to run over the proxy. That probably doesn’t work in your setup (unless you have allowed the original URL as well (and non HTTPS))

I would rather use port redirection for that, I do that in csf
192.168.1.43|32400|*|707|tcp

That also works with manual server input in Plex app on Android and PS4.

Hi.

We have reached a conclusion about this problem in another thread. Please read it and comment on what our options are.
Should I start a new thread to sheed light on the URL issue and perheps get plex’s attention with that?

forums.plex.tv/discussion/comment/1341834#Comment_1341834

Just commenting to confirm I’m seeing the same behavior. The key appears to be in getting Remote Access to understand that the IP which plex.tv sees me coming from (or even what my router says it is) may not be what I intend to have clients come talk to. Furthermore if I direct Remote Access to the port my reverse proxy is listening on, the reachability test fails.

For some clients, notably the web client, the custom URL directive works wonderfully and I’m able to reverse proxy just fine, but most remote clients continue to discover my server directly rather than coming through the reverse proxy.

My intended traffic flow for remote clients is CloudFlare -> nginx -> Plex.