# Plex reverse proxy

**URL:** <https://forums.plex.tv/t/plex-reverse-proxy/218945>\
**Category:** General Discussions\
**Created:** [December 25, 2017, 4:42am UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945 "2017-12-25T04:42:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prime-Omega](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prime-Omega](https://forums.plex.tv/u/Prime-Omega)\
**Post date:** [December 25, 2017, 4:42am UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/1 "2017-12-25T04:42:00Z")

</div>

Hi guys,

I’ve been trying to map Plex behind a reverse proxy for the past 2 days but so far my attempts have been futile. I think I have scavenged all the possible forums/threads out there looking for a solution but so far I have come up empty.

**Current working setup**  
[mydomain.com](http://mydomain.com)  
[mydomain.com/sonarr](http://mydomain.com/sonarr)  
[mydomain.com/radarr](http://mydomain.com/radarr)

**Trying to achieve**  
[mydomain.com/plex](http://mydomain.com/plex)

**Result #1**  
[pastebin.com/8BnAmAip](https://pastebin.com/8BnAmAip "https://pastebin.com/8BnAmAip")

- [mydomain.com/plex](http://mydomain.com/plex) gives a 401 unauthorized error

**Result #2**  
[pastebin.com/x3VNd79K](https://pastebin.com/x3VNd79K "https://pastebin.com/x3VNd79K")

- [mydomain.com/plex](http://mydomain.com/plex) works!
- BUT [mydomain.com](http://mydomain.com) suddenly returns a white page?

Any suggestions? Help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![kopfpilot](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kopfpilot/32/6687_2.png) [@kopfpilot](https://forums.plex.tv/u/kopfpilot)\
**Post date:** [December 25, 2017, 7:57pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/2 "2017-12-25T19:57:02Z")

</div>

I found a good working reverse proxy rule set thru google and pasted it here:

> **[How to setup nginx as a reverse proxy for plex?](https://forums.plex.tv/discussion/294332/how-to-setup-nginx-as-a-reverse-proxy-for-plex)**
>
> I spend quite some time to figure out how nginx needs to be configured to run a https vhost on port 443 and do a proper reverse proxying to my docker instance bound to localport:32400. Proxy\_pass sends the data to http://localhost:32400. When the...

Thanks to whomever originaly created the rule set!

---

<div class="post-metadata">

**Author:** ![Prime-Omega](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prime-Omega](https://forums.plex.tv/u/Prime-Omega)\
**Post date:** [December 26, 2017, 2:59pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/3 "2017-12-26T14:59:47Z")

</div>

> @kopfpilot said:  
> I found a good working reverse proxy rule set thru google and pasted it here:  
> [https://forums.plex.tv/discussion/294332/how-to-setup-nginx-as-a-reverse-proxy-for-plex](https://forums.plex.tv/discussion/294332/how-to-setup-nginx-as-a-reverse-proxy-for-plex)
> 
> Thanks to whomever originaly created the rule set!

Your script seems to be similar to my attempt/result #1. I just tried copy pasting the whole thing, changing my domain and I am getting 401 unauthorized errors.

The big difference is that I want / to redirect to my NAS GUI and /plex to plex.

---

<div class="post-metadata">

**Author:** ![kopfpilot](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kopfpilot/32/6687_2.png) [@kopfpilot](https://forums.plex.tv/u/kopfpilot)\
**Post date:** [December 26, 2017, 3:08pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/4 "2017-12-26T15:08:07Z")

</div>

> location /plex {  
> proxy\_pass [http://localhost:32400/web](http://localhost:32400/web);  
> }

Remove /web from you proxy\_pass. There are severall calls going to other context paths on the host:port.  
Also, you might like to take a look on the network tab of your browsers developer mode to take a look what is actualy called and succeeds or fails.

---

<div class="post-metadata">

**Author:** ![Prime-Omega](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prime-Omega](https://forums.plex.tv/u/Prime-Omega)\
**Post date:** [December 26, 2017, 6:49pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/5 "2017-12-26T18:49:36Z")

</div>

> @kopfpilot said:
> 
> > location /plex {  
> > proxy\_pass [http://localhost:32400/web](http://localhost:32400/web);  
> > }
> 
> Remove /web from you proxy\_pass. There are severall calls going to other context paths on the host:port.  
> Also, you might like to take a look on the network tab of your browsers developer mode to take a look what is actualy called and succeeds or fails.

Removing /web doesn’t change much, plex remains reachable that way but my NAS GUI doesn’t. What am I looking for specifically in the network debug?

For attempt #1 (plex working, GUI isn’t), I am getting 404 errors on my GUI. And for attempt #2 (GUI working, plex isn’t), I am just seeing a 401 error?

---

<div class="post-metadata">

**Author:** ![Prime-Omega](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prime-Omega](https://forums.plex.tv/u/Prime-Omega)\
**Post date:** [December 28, 2017, 12:29pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/6 "2017-12-28T12:29:56Z")

</div>

Bump, still struggling with this one. Has anyone managed to actually get /plex working?

---

<div class="post-metadata">

**Author:** ![Prime-Omega](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prime-Omega](https://forums.plex.tv/u/Prime-Omega)\
**Post date:** [January 2, 2018, 4:28pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/7 "2018-01-02T16:28:54Z")

</div>

Managed to solve it on my own, following code works:

[https://pastebin.com/n3MXHjps](https://pastebin.com/n3MXHjps)

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [January 2, 2018, 4:45pm UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/8 "2018-01-02T16:45:23Z")

</div>

Keep in mind: a Reverse Proxy makes **all requests** to the Plex server **appear like** they are coming from **within the local LAN**.

If you now combine this reverse proxy with a rule to disable the need to authenticate when a client accesses your Plex server from within the local network, you are wide open to unauthorized access.  
(Settings - Server - ‘Show Advanced’ - “List of IP addresses and networks that are allowed without auth”)

So, don’t use these both together.

---

<div class="post-metadata">

**Author:** ![feisu](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@feisu](https://forums.plex.tv/u/feisu)\
**Post date:** [February 28, 2018, 8:00am UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/9 "2018-02-28T08:00:37Z")

</div>

How do you guys prevent plex stream from [https://xxx.xxx62.plex.direct:32400/library/parts/2/1482093078/file.jpeg?download=1&X-Plex-Token=xxxxx](https://xxx.xxx62.plex.direct:32400/library/parts/2/1482093078/file.jpeg?download=1&X-Plex-Token=xxxxx)  
or something? like that?  
I set up a nginx reverse proxy for 127.0.0.1:32400 and deny 32400 from internet.  
first time it stream well from remote, it’s stream through revers proxy port 80  
[http://customdomain.com/library/parts/2/1482093078/file.jpeg?download=1&X-Plex-Token=1xxxxxx](http://customdomain.com/library/parts/2/1482093078/file.jpeg?download=1&X-Plex-Token=1xxxxxx)

but now it’s stream directy from plex 32400  
[https://xxx6.f77exxx62.plex.direct:32400/library/parts/2/1482093078/file.jpeg?download=1&X-Plex-Token=1xxxxxx](https://xxx6.f77exxx62.plex.direct:32400/library/parts/2/1482093078/file.jpeg?download=1&X-Plex-Token=1xxxxxx)

my question is how can I prevent it stream directy but through a reverse proxy?

Thanks. Hope I make my question clearly.

---

<div class="post-metadata">

**Author:** ![reichmuthph](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@reichmuthph](https://forums.plex.tv/u/reichmuthph)\
**Post date:** [May 9, 2019, 9:19am UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/10 "2019-05-09T09:19:41Z")

</div>

Dear all

Several uers seem to want to set up a reverse proxy for Plex. It seems several of them are usin nginx, and there can be found several working configuration for nginx. But all the one who want to use a different reverse proxy seem to be lost, me inclusive as I run pound reverse proxy ([http://www.apsis.ch/pound/](http://www.apsis.ch/pound/)) ([https://en.wikipedia.org/wiki/Pound\_(networking)](https://en.wikipedia.org/wiki/Pound_(networking))). Pound is a very simple resource saving reverse proxy, but needs to be configured completelly different than nginx. Therefore I am not familiar with nginx terminolgy and configuration.

To be able to set up pound or any other reverse proxy than nginx, it would be very helpfull, if someone could describe what the reverse proxy needs to do as a human-understandable description of the functionality, not just posting the code.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 12:20am UTC](https://forums.plex.tv/t/plex-reverse-proxy/218945/11 "2020-01-08T00:20:24Z")

</div>


