upstream block with their IP address and port. The upstream block is also where you configure load balancing behavior.location block where to send matched requests. The value can be a direct IP:port or a named upstream block. This is the core directive that makes Nginx a reverse proxy.*.example.com.The Complete Guide to Nginx Reverse Proxy Configuration
Nginx is the engine behind more than a third of the web's busiest sites. Its reverse proxy and upstream load balancing features let you put a fast, reliable gateway in front of any backend - Node.js, Python, Java, or anything that speaks HTTP. This guide explains every directive this tool generates so you can adapt it confidently.
How to Use This Tool
Enter your domain name and the port Nginx should listen on (port 80 for plain HTTP, or enable the 443 SSL toggle if you are terminating HTTPS here). Add at least one upstream server with its IP or hostname and port. If you add two or more servers, the tool generates a full upstream block and wires the proxy_pass directive to it. With a single server, it proxies directly. Choose a load balancing method and toggle any proxy headers on or off. The config updates instantly in the output panel above.
Understanding the Upstream Block
The upstream block defines a named pool of backend servers. Nginx selects a server from the pool for each request using your chosen balancing method. The block name (here backend_cluster) is arbitrary - you reference it in proxy_pass http://backend_cluster. If you only have one upstream server the upstream block is unnecessary, so this tool omits it and passes directly to the IP and port.
Proxy Headers Explained
X-Real-IP passes the original client IP to your backend. Without it, your app sees Nginx's loopback address for every request, making logs and IP-based rate limiting useless. X-Forwarded-For is the industry-standard header that accumulates IPs across a proxy chain, read by most frameworks automatically. X-Forwarded-Proto tells your backend whether the original client connected over HTTP or HTTPS - critical for apps that generate redirect URLs or set cookie security flags. Host preserves the original Host header value, which your backend may use for virtual hosting or link generation.
Deploying Your Config
Save the generated block to /etc/nginx/sites-available/yourdomain.conf, then symlink it: sudo ln -s /etc/nginx/sites-available/yourdomain.conf /etc/nginx/sites-enabled/. Test with sudo nginx -t before applying. If all is well, reload with sudo systemctl reload nginx. On RHEL-based systems, drop the file in /etc/nginx/conf.d/ instead.
Frequently Asked Questions
proxy_pass and upstream configuration.proxy_set_header X-Real-IP $remote_addr tells Nginx to attach the client's actual IP to the forwarded request. Your backend app can then read that header to log, rate-limit, or geo-restrict based on the true visitor IP.ip_hash, Nginx hashes the client's IP address and always routes that IP to the same upstream server (as long as the server is available). This creates sticky sessions without requiring any session cookie or shared session store on your backend. It is useful for applications that store session state locally on each server, but it can cause uneven load distribution if a small number of IPs generate most of your traffic./etc/nginx/sites-available/ using a descriptive filename like yourdomain.conf. After saving, create a symlink to /etc/nginx/sites-enabled/ with: sudo ln -s /etc/nginx/sites-available/yourdomain.conf /etc/nginx/sites-enabled/. Then test with sudo nginx -t and reload with sudo systemctl reload nginx. On some setups (RHEL, CentOS, or manual installs) you drop the file directly in /etc/nginx/conf.d/ instead.proxy_pass tells Nginx where to forward the incoming request. It can point to a specific IP and port like http://192.168.1.10:3000, or to a named upstream block like http://backend_cluster. When you define an upstream block with multiple servers, Nginx handles load balancing automatically using whichever method you specified (round robin by default).