Part 6: Nginx Reverse Proxy for Clean URLs

Febin JoyFebin Joy
2 min read

Welcome to Part 6 of the Ubuntu home lab series. Now that we have several apps running on different ports, it’s time to simplify access using Nginx as a reverse proxy. This lets us use URLs like http://jellyfin.myserver.home instead of IP:port combos.

🧠 Tip: Use your router or hosts file to map custom domains (e.g., myserver.home) to your server’s IP.


🌐 Step 1: Install Nginx

sudo apt update
sudo apt install -y nginx

Check if it’s running:

sudo systemctl status nginx

I decided to install Nginx locally on the server as it would be able to access port 80 of my server and route traffic to various apps/containers.


📁 Step 2: Set Up Config Directory

sudo mkdir -p /etc/nginx/conf.d

📝 Step 3: Create Reverse Proxy Config

sudo nano /etc/nginx/conf.d/myserver.conf

Add entries like the following for each service:

Jellyfin

server {
  listen 80;
  server_name jellyfin.myserver.home;

  location / {
    proxy_pass http://<your-server-ip>:8096;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

This will map http://jellyfin.myserver.home to http://<your-server-ip>:8096

Repeat similar blocks for other apps:

PostgreSQL (pgAdmin)

server {
  listen 80;
  server_name postgres.myserver.home;

  location / {
    proxy_pass http://<your-server-ip>:9876;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

Node-RED

server {
  listen 80;
  server_name nodered.myserver.home;

  location / {
    proxy_pass http://<your-server-ip>:1880;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

Homarr

server {
  listen 80;
  server_name dashboard.myserver.home;

  location / {
    proxy_pass http://<your-server-ip>:7575;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

🔍 Step 4: Test and Apply Nginx Config

1. Test configuration:

sudo nginx -t

2. Restart Nginx:

sudo systemctl restart nginx

🧭 Step 5: Add Hostname Mapping (on client machines)

Edit /etc/hosts (on Linux/macOS) or C:\Windows\System32\drivers\etc\hosts (on Windows) and add:

192.168.1.100 jellyfin.myserver.home postgres.myserver.home nodered.myserver.home dashboard.myserver.home

Replace 192.168.1.100 with your server’s actual IP.

Now you can access:

  • http://jellyfin.myserver.home

  • http://postgres.myserver.home

  • http://nodered.myserver.home

  • http://dashboard.myserver.home


✅ Final Notes

Your home lab is now:

  • Secure and hardened

  • Running in containers

  • Easily accessible via custom URLs

You can keep extending it with apps like Kavita, FreshRSS, Calibre-Web, or even GitLab. Just follow the same Podman + volume + Nginx proxy pattern.

Thanks for following along! 🧑‍💻

Feel free to share your thoughts or improvements at artofcoding.dev!

0
Subscribe to my newsletter

Read articles from Febin Joy directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Febin Joy
Febin Joy

Technical leader and architect with 20+ years of experience designing secure, scalable enterprise platforms across cloud, hybrid, and on-prem environments. Currently leading technical architecture and cross-functional teams delivering mobility and compliance systems used by 300+ organisations across Australia and New Zealand. Proven track record of translating complex compliance frameworks (HIPAA, ISO 27001) into production-grade systems. Skilled in Azure cloud migration, secure software development, and risk-driven design. Focused on architecting resilient platforms that enhance public safety, operational efficiency, and long-term engineering excellence. Based in Melbourne, Australian citizen, and a clear communicator with a strategic mindset.