Homelab & Self-Hosting

Running several services behind one server with Nginx Proxy Manager

If one server runs more than one project, sooner or later you hit ports 80 and 443, which only one process can listen on. A Habr article from the Selectel blog shows, step by step, how to solve this with Nginx Proxy Manager.

The author first explains the problem: privileged ports, the rule of one listener per port, CORS issues when frontend and backend are split across ports, and the lack of HTTPS. A reverse proxy solves this as an intermediary, routing traffic by domain and path. An extra benefit is that the firewall only needs ports 22, 80 and 443 open.

The test setup is a simple VDS with 2 vCPUs, 2 GB RAM and 40 GB NVMe, running Ubuntu 24.04 and Docker from the official repository. The network is created with docker network create proxy, and the jc21/nginx-proxy-manager container is started with volumes for data and certificates. I liked that the admin panel on port 81 is bound only to 127.0.0.1 and accessed through an SSH tunnel.

Next, a proxy host is configured: the Forward Hostname is the container name, and the SSL certificate is attached on the SSL tab. traefik/whoami is used for testing. The case where the application runs directly on the host is covered separately: the Docker network's gateway address is obtained with docker network inspect, and the firewall is set so the app cannot be reached bypassing the proxy.

There are some drawbacks too. The examples mix different domains, and the image uses the latest tag, so reproducibility may suffer over time. Still, it is a good starting point for anyone who wants to run several services at home or on a VDS without hand-editing nginx configs.

Source: Habr (Selectel blog)

Comments 0

Leave the first comment, in any language.

Log in to comment