Secure Web Hosting with Nginx Reverse Proxy

Overview

I implemented a reverse proxy to manage and secure multiple web services behind a single public IP address. This setup allows me to host various projects—including a gaming application and professional portfolios—while centralizing SSL/TLS encryption and protecting backend server identities.

Architecture

Reverse proxy routing diagram

The reverse proxy acts as a traffic controller, directing incoming requests to the appropriate internal service based on the subdomain:

Implementation

I utilized a VPS running Linux and configured Nginx as the primary entry point. Each service is isolated, and Nginx handles the proxy_passdirectives. To ensure security, I integrated Let's Encrypt to provide automatic HTTPS across all subdomains.

Nginx configuration snippet

Troubleshooting

One of the most challenging hurdles was a connectivity issue where I couldn't access the subdomains from my local machine, even though the services appeared to be running correctly.

I spent significant time auditing the entire stack:

The root cause turned out to be browser-level security enforcement. Modern browsers (like Chrome and Brave) often refuse to load unencrypted HTTP sites for certain domains or cached HSTS settings. I resolved this by manually running Certbot to generate SSL certificates for each subdomainbefore attempting to load them. Once the Nginx blocks were listening on port 443 with valid certs, the browser immediatey allowed the connection.

Results

Technologies Used