Nginx 1 · Reverse proxy and TLS

Proxy to an app

Forward requests to an app on port 3000 and pass the original host and client address.

location / {
    proxy_pass http://127.0.0.1:3000;
    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;
}

Official Nginx 1 documentation

More reverse proxy and tls commands

All reverse proxy and tls commands · Nginx 1 cheatsheet

Was this page helpful?