Web / NGINX Interview questions
Define upstream in NGINX?
An upstream block defines a named group of one or more backend servers that NGINX can proxy requests to. It's declared at the http level and referenced by name inside a proxy_pass directive.
upstream backend_app { server 10.0.0.11:8080; server 10.0.0.12:8080; } server { location / { proxy_pass http://backend_app; } }
Beyond listing servers, the upstream block is where load-balancing algorithm, weights, and health-check-related parameters like max_fails and fail_timeout are configured.
More Related questions...