# PMS behind Apache Proxy

**URL:** <https://forums.plex.tv/t/pms-behind-apache-proxy/15642>\
**Category:** General Discussions\
**Created:** [March 13, 2012, 5:23pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642 "2012-03-13T17:23:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Makash](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Makash](https://forums.plex.tv/u/Makash)\
**Post date:** [March 13, 2012, 5:23pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/1 "2012-03-13T17:23:10Z")

</div>

Where to find config file
I would like to use the web interface of Plex behind a proxy/proxyreverse of my Apache server.  
  
It allows me to use only one port and some restrictions for a lot of web applications.   
  
I used to put this in my apache conf :   
  
  
 ProxyPass http://localhost:32400/manage  
 ProxyPassReverse http://localhost:32400/manage  
  
  
But for PMS, I need to configure it to use /plexmediaserver as root web url.   
  
Where can I configure this ? And change the default port in the same way ?  
  
Thanks a lot

---

<div class="post-metadata">

**Author:** ![ziggimon](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ziggimon/32/305_2.png) [@ziggimon](https://forums.plex.tv/u/ziggimon)\
**Post date:** [March 13, 2012, 5:39pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/2 "2012-03-13T17:39:23Z")

</div>

You could try this:

```auto

<br />
<VirtualHost *:80><br />
<br />
ServerName pms<br />
	<br />
RewriteEngine on<br />
RewriteCond %{REQUEST_URI} !^/manage<br />
RewriteRule ^/$ /manage/$1 [R]<br />
<br />
ProxyPass / http://localhost:32400/<br />
ProxyPassReverse / http://localhost:32400/<br />
<br />
ErrorLog /var/logs/httpd/error_log<br />
CustomLog /var/logs/httpd/access_log combined env=!dontlog<br />
<br />
</VirtualHost><br />
<br />

```

  
  
This works for me. But its just a virtual host.  
/Mark

---

<div class="post-metadata">

**Author:** ![NEI](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@NEI](https://forums.plex.tv/u/NEI)\
**Post date:** [March 25, 2012, 7:56pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/3 "2012-03-25T19:56:35Z")

</div>

> [@](#):
>
> But for PMS, I need to configure it to use /plexmediaserver as root web url.   
>   
> Where can I configure this ? And change the default port in the same way ?

  
  
I asked myself the same. I am too stupid to configure apache on my mac. I need to have access on www.mypage.com/plex. Didn't work so far. The solution here is working if I access it on www.mypage.com, but that's not what I want. How can we configure the web root of PMS?  
  
Thanks

---

<div class="post-metadata">

**Author:** ![Makash](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Makash](https://forums.plex.tv/u/Makash)\
**Post date:** [March 26, 2012, 9:12am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/4 "2012-03-26T09:12:42Z")

</div>

> [@](#):
>
> I asked myself the same. I am too stupid to configure apache on my mac. I need to have access on www.mypage.com/plex. Didn't work so far. The solution here is working if I access it on www.mypage.com, but that's not what I want. How can we configure the web root of PMS?  
>   
> Thanks

  
  
I still didn't find any solutions. The ZiGGiMoN's one seems to be only when you have a dedicated webpage for PMS, not appropriate for my case.   
  
  
I think I really need to change the web root of PMS. Anyone ?

---

<div class="post-metadata">

**Author:** ![tobiashieta](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tobiashieta/32/82153_2.png) [@tobiashieta](https://forums.plex.tv/u/tobiashieta)\
**Post date:** [March 26, 2012, 1:49pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/5 "2012-03-26T13:49:40Z")

</div>

> [@](#):
>
> I still didn't find any solutions. The ZiGGiMoN's one seems to be only when you have a dedicated webpage for PMS, not appropriate for my case.   
>   
>   
> I think I really need to change the web root of PMS. Anyone ?

  
  
It's not possible, PMS is not a real web server, just a API that happen to work over http. I don't understand why a apache rewrite rule wouldn't work for you.

---

<div class="post-metadata">

**Author:** ![Makash](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Makash](https://forums.plex.tv/u/Makash)\
**Post date:** [March 26, 2012, 2:17pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/6 "2012-03-26T14:17:53Z")

</div>

Maybe I didn’t use the apache rewrite rules correctly.  
  
In my conf, I have other proxy pass for some services (like sabnzbd for example).  
  
And my webroot (www.mydomain.tld) is used for my website. It’s why I configure my apache to use mydomain.tld/service/ for each services I have. For those services, I just have to proxypass to the localhost:port of the service and to define a new web root for the service.   
  
  
  
But maybe I’m wrong in my conf, I’m not really good with apache conf.

---

<div class="post-metadata">

**Author:** ![NEI](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@NEI](https://forums.plex.tv/u/NEI)\
**Post date:** [March 26, 2012, 2:57pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/7 "2012-03-26T14:57:36Z")

</div>

> [@](#):
>
> But maybe I'm wrong in my conf, I'm not really good with apache conf.

  
  
Yeah, same here! And I manged to get it working somehow once over root, but just to find out that there are even other URLs to rewrite. Cannot remember, I think it wanted to access "/scripts/...". I gave up then as I already didn't knew why it was working... :-)

---

<div class="post-metadata">

**Author:** ![ziggimon](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ziggimon/32/305_2.png) [@ziggimon](https://forums.plex.tv/u/ziggimon)\
**Post date:** [March 26, 2012, 5:49pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/8 "2012-03-26T17:49:44Z")

</div>

My theory is. If the /manage interface isnt a true webserver, it would explain why you cant do a simple alias + proxy to the interface. Having a lot of variable content from various locations is an impossible structure for apache proxy module to handle. Alias/Location work against the design of the proxypass module. And requires a section such as: proxypass /location !  
  
You can redirect eg /yourlocation/manage via proxypass but it can’t predict the API requests that the manage interface returns via the proxy. So the interface from the browser will request content at eg /library/…content… And that path is not working for the Alias/Location tag. Some hardcore rewrite rule writing by someone very familiar to the interface might work around this. But far from a simple task.  
  
  
  
I did manage to get the basic frame to appear but not the content. Didn’t have time to play around a lot with rewriting. The whole thing will work with vhost because proxying is based on / and forward. So all /library /manage and so on requests will work.  
  
  
  
Anyone up for a lot of tracing and rewriting? (and hardcore regex) 🙂  
  
  
  
/Mark  
  
  
  
More thoughts on this is more than welcome.

---

<div class="post-metadata">

**Author:** ![Makash](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Makash](https://forums.plex.tv/u/Makash)\
**Post date:** [March 26, 2012, 5:53pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/9 "2012-03-26T17:53:57Z")

</div>

> [@](#):
>
> My theory is. If the /manage interface isnt a true webserver, it would explain why you cant do a simple alias + proxy to the interface. Having a lot of variable content from various locations is an impossible structure for apache proxy module to handle. Alias/Location work against the design of the proxypass module. And requires a section such as: proxypass /location !  
> You can redirect eg /yourlocation/manage via proxypass but it can't predict the API requests that the manage interface returns via the proxy. So the interface from the browser will request content at eg /library/...content... And that path is not working for the Alias/Location tag. Some hardcore rewrite rule writing by someone very familiar to the interface might work around this. But far from a simple task.

  
  
I think it's exactly this problem. But no idea for the solution.

---

<div class="post-metadata">

**Author:** ![ziggimon](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ziggimon/32/305_2.png) [@ziggimon](https://forums.plex.tv/u/ziggimon)\
**Post date:** [March 26, 2012, 6:05pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/10 "2012-03-26T18:05:58Z")

</div>

Hardcore rewrite rules using more hardcore regex would be my guess 🙂  
  
  
  
/Mark

---

<div class="post-metadata">

**Author:** ![NEI](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@NEI](https://forums.plex.tv/u/NEI)\
**Post date:** [March 29, 2012, 12:03pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/11 "2012-03-29T12:03:55Z")

</div>

> [@](#):
>
> Hardcore rewrite rules using more hardcore regex would be my guess :)  
>   
> /Mark

  
I tried, but didn't get it. It is really a shame that PMS cannot be stuck behind a reverse proxy easily... :-(

---

<div class="post-metadata">

**Author:** ![NEI](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@NEI](https://forums.plex.tv/u/NEI)\
**Post date:** [March 30, 2012, 6:00am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/12 "2012-03-30T06:00:59Z")

</div>

My workaround for now is to use the direct link to the menagement interface when going through myPlex. But there I am asked for a password, but my “myPlex” password is not working?!? What password do I need there? Somebody knows it?  
  
  
  
_Edit_  
  
This is the url I use: [http://MyServerIp:19117/manage/index.html](http://MyServerIp:19117/manage/index.html).  
  
One problem with this for me is also, that it is not over https. ☹  
  
_Edit_

---

<div class="post-metadata">

**Author:** ![sunny78](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sunny78](https://forums.plex.tv/u/sunny78)\
**Post date:** [June 16, 2012, 8:26am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/13 "2012-06-16T08:26:16Z")

</div>

Hi Guys,  
  
  
  
I found the following workaround, which is at least working to have access to the manager:

```auto

<br />
<Location /manage><br />
    ProxyPass http://localhost:32400/manage<br />
    ProxyPassReverse http://localhost:32400/manage<br />
</Location><br />
<Location /library><br />
    ProxyPass http://localhost:32400/library<br />
    ProxyPassReverse http://localhost:32400/library<br />
</Location><br />
<Location /photo><br />
    ProxyPass http://localhost:32400/photo<br />
    ProxyPassReverse http://localhost:32400/photo<br />
</Location><br />

```

  
  
I still get some errors in apache for some access to /system or /security but at least i have what i need: access to manager, browse, view images and descriptions, do update :roll eyes:  
  
In fact adding /system allows to update descriptions/fix incorrect match, for security i have no idea right now

---

<div class="post-metadata">

**Author:** ![ziggimon](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ziggimon/32/305_2.png) [@ziggimon](https://forums.plex.tv/u/ziggimon)\
**Post date:** [June 16, 2012, 8:59am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/14 "2012-06-16T08:59:50Z")

</div>

A dedicated vhost with a proxypass setting for / should solve it. It would proxy all URLs including /security, and make it work.  
  
  
  
It’s the only way I have found to make all things work. Because the webinterface is made up of more than just html traffic.  
  
  
  
/Mark

---

<div class="post-metadata">

**Author:** ![sunny78](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sunny78](https://forums.plex.tv/u/sunny78)\
**Post date:** [June 16, 2012, 9:52am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/15 "2012-06-16T09:52:21Z")

</div>

we should ask developers to put a prefix (like /plex or something like that) to make all this easier. I cannot create a complete vhost as i have other stuff running to.

---

<div class="post-metadata">

**Author:** ![ziggimon](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ziggimon/32/305_2.png) [@ziggimon](https://forums.plex.tv/u/ziggimon)\
**Post date:** [June 16, 2012, 10:22am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/16 "2012-06-16T10:22:23Z")

</div>

> [@](#):
>
> we should ask developers to put a prefix (like /plex or something like that) to make all this easier. I cannot create a complete vhost as i have other stuff running to.

  
  
The way the tech works currently a /plex prefix wouldn't be possible, bc the UI fetches data vi the same API as clients to too.  
  
If you have DNS control of you domain, and are not running any SSL specific stuff, its always possible to create a vhost. In apache you just have to reconfigure your config to have a default site, and then enable namebased vhosts, and create a pms.yourdomain.com vhost. That should work fine. I have many sites and vhosts on my apache. All working fine.  
  
/Mark

---

<div class="post-metadata">

**Author:** ![ananke](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@ananke](https://forums.plex.tv/u/ananke)\
**Post date:** [December 4, 2012, 3:02am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/17 "2012-12-04T03:02:26Z")

</div>

With the most recent version of plex, here are the added items that are needed to make it work. Hope others may find it useful.

```
ProxyPass http://localhost:32400/web
ProxyPassReverse http://localhost:32400/web

\<Location /system\>  
ProxyPass [http://localhost:32400/system](http://localhost:32400/system)  
ProxyPassReverse [http://localhost:32400/system](http://localhost:32400/system)

\<Location /servers\>  
ProxyPass [http://localhost:32400/servers](http://localhost:32400/servers)  
ProxyPassReverse [http://localhost:32400/servers](http://localhost:32400/servers)

\<Location /accounts\>  
ProxyPass [http://localhost:32400/accounts](http://localhost:32400/accounts)  
ProxyPassReverse [http://localhost:32400/accounts](http://localhost:32400/accounts)

\<Location /myplex\>  
ProxyPass [http://localhost:32400/myplex](http://localhost:32400/myplex)  
ProxyPassReverse [http://localhost:32400/myplex](http://localhost:32400/myplex)

\<Location /photo\>  
ProxyPass [http://localhost:32400/photo](http://localhost:32400/photo)  
ProxyPassReverse [http://localhost:32400/photo](http://localhost:32400/photo)

\<Location /clients\>  
ProxyPass [http://localhost:32400/clients](http://localhost:32400/clients)  
ProxyPassReverse [http://localhost:32400/clients](http://localhost:32400/clients)
```

---

<div class="post-metadata">

**Author:** ![kooimens](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@kooimens](https://forums.plex.tv/u/kooimens)\
**Post date:** [December 29, 2012, 7:22pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/18 "2012-12-29T19:22:22Z")

</div>

Thanks Ananke, that’s nice.   
  
  
  
One more question, all my apps are running through a proxy on my site, but is it possible to make the http:// **.**. **.** :11193/web/ tunneled to https? I think it should be possible in the same way with port 32400 (for managing) because i don’t want al my users able to manage my server. On the other hand i don’t want an unsecured connection to my server with http. I use my domain \*\*\*.info, which tunnels everything through https.   
  
  
  
In summary, i need a solution to make a proxy for port 11193, like the one for 32400.

---

<div class="post-metadata">

**Author:** ![EnterpriseOne](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@EnterpriseOne](https://forums.plex.tv/u/EnterpriseOne)\
**Post date:** [April 25, 2013, 3:07pm UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/19 "2013-04-25T15:07:45Z")

</div>

Has anyone gotten this to work properly yet?

I'm trying to make Plex accesible from a subdomain but a piece of the url is simply vanishing.

[http://forums.plexapp.com/index.php/topic/67156-plex-access-via-subdomain/](http://forums.plexapp.com/index.php/topic/67156-plex-access-via-subdomain/)

---

<div class="post-metadata">

**Author:** ![smdion](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/smdion/32/6129_2.png) [@smdion](https://forums.plex.tv/u/smdion)\
**Post date:** [May 13, 2013, 2:44am UTC](https://forums.plex.tv/t/pms-behind-apache-proxy/15642/20 "2013-05-13T02:44:30Z")

</div>

I got it to work with Ananke's changes. Thanks!

[Next page](https://forums.plex.tv/t/pms-behind-apache-proxy/15642.md?page=2)
