Running Plex Media Server on Port 80 with Apache

If you are behind a network device that blocks Plex Media Server’s port 32400, there is hope. Changing the port in the server configuration doesn’t seem to work so the best bet is to have an Apache server run a proxy/reverse proxy configuration.

We have an Ubuntu server running on port 80, with Plex running on port 32400. Edit the 000-default.conf file located in /etc/apache2/sites-enabled to look like the following:

	<Location /web>
        ProxyPass http://localhost:32400/web
        ProxyPassReverse http://localhost:32400/web
        </Location>

        <Location /system>
        ProxyPass http://localhost:32400/system
        ProxyPassReverse http://localhost:32400/system
        </Location>

        <Location /servers>
        ProxyPass http://localhost:32400/servers
        ProxyPassReverse http://localhost:32400/servers
        </Location>

        <Location /accounts>
        ProxyPass http://localhost:32400/accounts
        ProxyPassReverse http://localhost:32400/accounts
        </Location>

        <Location /myplex>
        ProxyPass http://localhost:32400/myplex
        ProxyPassReverse http://localhost:32400/myplex
        </Location>

        <Location /photo>
        ProxyPass http://localhost:32400/photo
        ProxyPassReverse http://localhost:32400/photo
        </Location>

        <Location /clients>
        ProxyPass http://localhost:32400/clients
        ProxyPassReverse http://localhost:32400/clients
        </Location>

Make sure you have mod_proxy_http and mod_proxy enabled. One or both of these might already be enabled, but it won’t hurt to run the commands below:

        sudo a2enmod proxy
        sudo a2enmod proxy_http

After the mods are enabled, restart apache:

        sudo service apache2 restart

Now when you go to your server on port 80 with any of the locations (for instance, /web), Apache will seamlessly redirect the communication to port 32400. To your browser, and your network appliance that is blocking 32400, it will look like it is on port 80 still.

The first server is running fine like this. We had some trouble with second server setup where it didn’t seem to like “localhost” url. After changing it to the fully qualified domain name, it works like a charm.

3 thoughts on “Running Plex Media Server on Port 80 with Apache

Leave a Reply

Your email address will not be published. Required fields are marked *