Skip to content
Free website migration on every plan, done by our team.Learn more ›
Servers

Nginx as a reverse proxy, explained

What a reverse proxy does, why Nginx is popular for it, how it routes domains to apps, handles SSL and caching, and a simple configuration example.

Short answer: A reverse proxy sits in front of your apps, receives visitors' requests and passes them to the right app behind it. Nginx is widely used for this because it's fast and efficient. It also handles HTTPS, compression and caching in one place.

What a reverse proxy does

  • Routes domains: app1.yourdomain.com to one app, app2 to another.
  • Terminates SSL: handles HTTPS so apps don't have to.
  • Compresses and caches responses. See Gzip vs Brotli.
  • Hides internal ports from the internet.

A simple example

server {
    server_name app.yourdomain.com;
    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Then add a free certificate with Certbot. See free SSL certificates.

Common uses

Frequently asked questions

Is a reverse proxy the same as a CDN?

No. A CDN is a network of servers worldwide; a reverse proxy usually runs on your own server. See what a CDN is.

Does it slow things down?

The overhead is tiny, and caching often makes sites faster.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.