NGINX Reverse Proxy and Load Balancing
NGINX can sit between clients and application servers, forwarding each request to a chosen backend. As a reverse proxy and load balancer, it gives clients one entry point while distributing traffic across multiple servers.
itWeb servers, proxies, and traffic management | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
NGINX Reverse Proxy and Load Balancing
Your client does not need to know where every application instance runs. It can send requests to one NGINX endpoint. NGINX then selects a backend, forwards the request, receives the response, and returns that response to the client.
That is the central mental model:
client → NGINX → backend
└──→ backend
└──→ backend
NGINX is the reverse proxy because it represents servers to clients. A forward proxy represents clients when they reach external resources.
Why put NGINX in the request path?
A reverse proxy gives you one place to route requests and control how they reach applications. You can use different location blocks to serve files, send requests to one server, or send requests to an upstream group.
An upstream group names a set of backend servers. When proxy_pass points to that group, NGINX chooses a server for each request. The default method is weighted round robin.
This arrangement helps you:
- Hide backend addresses from clients.
- Spread requests across application instances.
- Route different URI spaces to different services.
- Preserve one client-facing endpoint while backends change.
- Terminate client connections and manage separate upstream connections.
- Buffer responses so a slow client does not hold a backend busy for the entire download.
The extra hop also creates responsibility. NGINX becomes part of the application's behavior and failure path. You must define request headers, URI mapping, timeouts, retry behavior, logging, and upstream security deliberately.
The configuration map
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy
Supports
- Reverse-proxy request flow and supported upstream protocols
- proxy_pass placement, URI replacement, request-header defaults, and proxy_set_header
- Default response buffering, buffer controls, and behavior when buffering is disabled
- https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/
Supports
- Upstream groups and proxy_pass to a named group
- Weighted round robin, least connections, IP hash, generic hash, weights, backup servers, and product capability boundaries
- https://nginx.org/en/docs/http/ngx_http_proxy_module.html
Supports
- Exact proxy_pass URI mapping and request-header directive behavior
- Proxy buffering, connect, send, and read timeout semantics
- proxy_next_upstream conditions and the response-sent retry boundary
- https://nginx.org/en/docs/http/ngx_http_upstream_module.html
Supports
- Upstream server weights, max_fails, fail_timeout, backup, and down parameters
- Load-balancing directives, passive failure handling, consistent hashing, and upstream timing variables
- https://docs.nginx.com/nginx/admin-guide/load-balancer/http-health-check/
Supports
- Passive health checks based on request outcomes
- Active periodic health checks as an NGINX Plus capability
- https://docs.nginx.com/nginx/admin-guide/security-controls/securing-http-traffic-upstream/
Supports
- HTTPS proxy_pass for encrypted upstream traffic
- Upstream certificate trust, verification, and optional client-certificate configuration
- https://docs.nginx.com/nginx/admin-guide/monitoring/logging/
Supports
- Error and access logging
- request, upstream connection, upstream header, and upstream response timing variables
- https://nginx.org/en/docs/beginners_guide.html
Supports
- Configuration hierarchy, master and worker responsibilities, and reload behavior
- New-worker startup, graceful old-worker retirement, and retention of the old configuration after a failed apply
- https://nginx.org/en/docs/switches.html
Supports
- Configuration syntax and referenced-file checks with nginx -t
- Reload signals and other command-line parameters
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the curated NGINX resources list
- https://github.com/fcambus/nginx-resources
Supports
- Discovery of Gixy, BunkerWeb, OpenResty, and Kong as NGINX-related ecosystem projects
- https://gixy.getpagespeed.com/
Supports
- Gixy as an NGINX configuration analyzer for security misconfiguration and flaw detection
- Documented checks covering proxy-pass paths, headers, access control, TLS, DNS, and regular expressions
- https://docs.bunkerweb.io/
Supports
- BunkerWeb as an open-source NGINX-based web application firewall and reverse proxy
- Documented Linux, Docker, Swarm, and Kubernetes integrations
- https://openresty.org/en/
Supports
- OpenResty as a web and gateway platform combining NGINX, LuaJIT, Lua libraries, and NGINX modules
- https://developer.konghq.com/gateway/
Supports
- Kong Gateway as an API reverse proxy for request management, configuration, and routing
- Plugin extension and distributed-architecture positioning
