Skip to main content
Only one process can listen on port 80 at a time. A reverse proxy solves that: Nginx sits on ports 80 and 443, and forwards each request to the right backend app based on the domain. Run a Node.js app, a Python API, and a static site side by side on one Opus Host VPS.

Install Nginx

See Web Server if you want a fuller intro.

Example: proxy a Node.js app on port 3000

Suppose your app runs on localhost:3000 (see Node.js & PM2). Create /etc/nginx/sites-available/app.example.com:
Enable and reload:

Add a second app on another subdomain

Repeat the pattern with a new file and a different server_name and proxy_pass port:
Each app listens on its own local port. Nginx handles the public entry point.

Serve static files alongside proxied apps

Add HTTPS

Run Certbot to add HTTPS to each domain. See Let’s Encrypt SSL.
Bind your backend apps to 127.0.0.1 instead of 0.0.0.0 so they are not reachable from outside. Nginx is the only public entry point.

Test and reload safely

Always test the config before reloading. Nginx will refuse to reload a broken config, but catching mistakes early saves headaches: