Configure Reverse Proxy nginx Linux

Configure Reverse Proxy nginx Linux to conveniently access your Plex request lists on your home media server or NAS. When you are away from home then you can log in to your server and see the CouchPotato web interface. For ultimate convenience with your reverse proxy for people with dynamic IP addresses, use a free dynamic DNS service like AfraidDNS (guide for automating), DuckDNS or No-IP.

After implementing a reverse proxy you can access via your custom DNS address like instead of http://IP:3579. This reverse proxy how-to was tested on Debian and Ubuntu but the nginx virtual host should work on any Linux system (CentOS, Red Hat, Fedora, Arch etc).

Configure for Reverse Proxy nginx Linux supports custom URL bases so we need to set that first.

After the custom URL base (e.g. /request) is set we can use nginx to proxy that location from the internet IP or Dynamic DNS address to

Configure for Reverse Proxy

Open up your web interface on http://ip.address:3579/settings

Log in as your admin user and go to Settings in the top right

Set your Base Url to request this will be the location you use in nginx.

Scroll down and click Submit


Then restart the system service to activate the base url.

sudo service restart

Now when you access CouchPotato's web interface by its port and Url Base e.g. http://ip.address:3579/request

Configure nginx as Reverse Proxy for

Install nginx

sudo apt-get install nginx -y

Create a new nginx site

sudo nano /etc/nginx/sites-available/reverse

Add these lines, adjust your dynamic dns address and local IP address. If you changed your default port change to reflect your port. If you used a Base URL that was not /request then replace /request with your custom location.

For the reverse proxy to work, the Base URL in must match the nginx location or you will get a 502 Bad Gateway error.

If you already have an nginx reverse proxy set up you only need to add the blue block location.

server {
listen 80;
error_log /var/log/nginx/reverseproxy.log;

location /request {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Ctrl+X, Y and enter to save and exit

Disable the default nginx site

sudo unlink /etc/nginx/sites-enabled/default

Enable the reverse proxy site with enabled

sudo ln -s /etc/nginx/sites-available/reverse /etc/nginx/sites-enabled/reverse

Test the nginx configuration is valid and working

sudo nginx -t

Restart the nginx service

sudo service nginx restart

You can now access locally within your home network at http://ip.address/request or using your dynamic DNS address.

For maximum security consider using https for your reverse proxy to encrypt communication outside your home network.