Category Archives: DNS

Plex Web Interface Redirection

I have been using Plex for quite some time, and one of thing which was annoying to me was the way to access Plex.

The typical way Plex is accessed is via a local IP address at http://localipaddress:32400/web/. Changing the bit to make Plex available to the outside is a bad idea, as there is no restriction.

I wanted to do a redirection via my domain to have the following:

It was not easy to find a solution, and i ended finding that I have to do a reverse proxy, and redirecting the address to the Plex server.

For this, luckily, I already had my Kubuntu virtual machine with Apache.

On top of that, a couple of days later, I stumbled on the very good article of Matt Coneybeare

The right way to do it securely is mentioned at the end of the article.

  1. Setup a DNS entry for box using the interface of your DNS provider
  2. Setup port forwarding on port 80 to your Plex server’s port 32400.
  3. Add the following code within etc/apache2/httpd.conf:
    <VirtualHost *:80>
        <Location />
            AuthType Basic
            AuthName "Restricted area"
            AuthUserFile /private/etc/apache2/htpasswd
            Require valid-user
        <Proxy *>
            Order deny,allow
            Allow from all
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyPass /
        ProxyPassReverse /
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !^/web
        RewriteCond %{HTTP:X-Plex-Device} ^$
        RewriteRule ^/$ /web/$1 [R,L]
  4. If you do not have a htpasswd file created already (you probably don’t), you can create one by running the following commands in the Terminal:
    $ cd /private/etc/apache2
    sudo htpasswd -bc htpasswd [username] [password] 

    Replace the username and password with what you would like

  5. Restart the server by running
    $ sudo apachectl restart

    Now you have a secure redirection for the Plex Web interface.
    This will give you access to the Plex Web interface as if you were on your LAN.

Domain Name DNS

For my past website, I had been using a free domain name provided by a DNS hosting service,  first by DynDNS and when they changed their policy to not support free domain service, I moved to No-IP. I got tired of the renewal via a link every 30 days with No-IP so I decided to by a domain name. I did some research and finally decided to go with Namecheap. I bought my domain named for 5 years for 38.45 $ (7.69 $ per year), this was quite the deal and I won’t have to deal with those annoying renewal every 30 days. On top of that, I can have subdomains for different applications.