Nginx Interview Questions
Reverse proxying & load balancing, the event-driven master/worker architecture, server & location blocks, static file serving, proxy caching, SSL/TLS termination, rate limiting, upstreams and performance tuning.
61 questions
Popular Searches
1. What is Nginx and what problems does it solve?
easyFundamentals 6 mins2. What is the difference between Nginx and Apache HTTP Server?
mediumWeb Servers 7 mins3. What is a reverse proxy and how does Nginx act as one?
mediumReverse Proxy 7 mins4. What is the difference between a forward proxy and a reverse proxy?
easyProxying 6 mins5. How does Nginx work as a load balancer and what algorithms does it support?
mediumLoad Balancing 7 mins6. What is the Nginx event-driven architecture and why is it efficient?
hardArchitecture 8 mins7. What is the difference between the Nginx master process and worker processes?
mediumArchitecture 6 mins8. How does the Nginx configuration file structure work with contexts and directives?
mediumConfiguration 6 mins9. What is the difference between a location block and a server block in Nginx?
mediumConfiguration 6 mins10. How does Nginx match location blocks and what is the priority order?
mediumRouting 6 mins11. How do you configure Nginx to serve static files efficiently?
easyStatic Content 6 mins12. What is Nginx caching and how does proxy_cache work?
hardCaching 7 mins13. How do you set up SSL/TLS termination in Nginx?
mediumSecurity 7 mins14. What is the difference between proxy_pass and fastcgi_pass in Nginx?
mediumReverse Proxy 7 mins15. How does Nginx handle gzip compression?
easyPerformance 6 mins16. What are upstream servers in Nginx and how do you configure them?
mediumLoad Balancing 7 mins17. How does Nginx implement rate limiting?
mediumTraffic Control 7 mins18. What is the difference between Nginx and Nginx Plus?
easyEditions 6 mins19. How do you configure Nginx as an API gateway?
hardAPI Gateway 7 mins20. What are the common Nginx timeouts and why do they matter?
mediumTimeouts & Tuning 7 mins21. How does Nginx handle keepalive connections?
mediumConnections 7 mins22. How do you configure virtual hosts (server blocks) in Nginx?
mediumServer Blocks 6 mins23. What is the try_files directive in Nginx and how does it work?
mediumRequest Routing 6 mins24. How does Nginx handle redirects with return and rewrite?
mediumRedirects 6 mins25. What is the difference between rewrite and return in Nginx?
mediumURL Handling 6 mins26. How do you troubleshoot a 502 Bad Gateway error in Nginx?
mediumTroubleshooting 7 mins27. How does Nginx logging work with access logs and error logs?
easyLogging 6 mins28. How do you optimize Nginx performance for high traffic?
hardPerformance Tuning 7 mins29. What is the role of worker_connections and worker_processes in Nginx?
mediumArchitecture 6 mins30. How does Nginx serve as a web server versus a proxy?
mediumCore Concepts 6 mins31. Why does proxy_pass behave differently with and without a trailing slash?
hardReverse Proxy 7 mins32. How do you proxy WebSocket traffic through Nginx correctly?
mediumReverse Proxy 7 mins33. What is proxy buffering in Nginx and when should you turn it off?
hardPerformance 8 mins34. Why is 'if' considered dangerous inside an Nginx location block?
hardConfiguration 7 mins35. How do you recover the real client IP when Nginx sits behind a CDN or load balancer?
hardSecurity 8 mins36. How do you configure mutual TLS client certificate authentication in Nginx?
hardSecurity 8 mins37. How do you upgrade the Nginx binary without dropping connections?
hardOperations 8 mins38. How does the Nginx stream module differ from the http module for load balancing?
hardLoad Balancing 8 mins39. How do you stop a cache stampede in Nginx when a hot cached object expires?
hardCaching 9 mins40. How do you debug an Nginx configuration that behaves differently from what you read in the files?
mediumTroubleshooting 8 mins41. The error log fills with 'too many open files'. How do you diagnose and fix descriptor exhaustion in Nginx?
hardOperations & Reliability 9 mins42. You enable HTTP/2 and later HTTP/3 in Nginx. What changes operationally, and what breaks?
hardProtocols & TLS 10 mins43. Some clients reject your certificate while browsers accept it. How do you debug chain and OCSP stapling problems in Nginx?
hardProtocols & TLS 10 mins44. The error log says a shared memory zone is full. What does that mean and how do you size zones correctly?
hardOperations & Reliability 10 mins45. After a reload you still see old 'worker process is shutting down' processes hours later. What is happening?
hardOperations & Reliability 9 mins46. One slow backend makes the whole upstream group fail. How do proxy_next_upstream and passive health checks contribute?
hardLoad Balancing 11 mins47. Large uploads fail with 413 or stall on disk. How does Nginx handle the request body?
hardReverse Proxy 10 mins48. You need session affinity without Nginx Plus. How do ip_hash and hash consistent compare, and where do they fail?
hardLoad Balancing 10 mins49. A custom error page produces an infinite loop or the wrong status code. How do error_page and internal redirects really work?
hardConfiguration & Routing 10 mins50. How does TLS session resumption work in Nginx, and why is ticket key rotation a security decision?
hardProtocols & TLS 10 mins51. How does the auth_request module delegate authorisation, and what are its failure modes?
hardSecurity 11 mins52. Nginx keeps sending traffic to an old container IP after a redeploy. How does upstream DNS resolution actually work?
hardReverse Proxy 11 mins53. Walk through Nginx's request phases: how do rewrite and internal redirects change which location ends up handling a request?
hardRequest Processing 9 mins54. A request is being served by the wrong location block. How do you work out which one actually matched, and why?
hardRequest Processing 9 mins55. Which headers must you set when proxying with Nginx, and what breaks in the backend if you get Host and X-Forwarded-* wrong?
mediumProxying 9 mins56. Why do some headers disappear across an Nginx proxy hop, and why does adding one proxy_set_header wipe out the others?
hardProxying 9 mins57. Why can one slow client tie up a backend worker through Nginx, and how does buffering prevent it?
hardPerformance 9 mins58. A proxied request failed. How do you tell from the logs which timeout fired, and why is it a 502 rather than a 504?
hardTroubleshooting 10 mins59. You added keepalive to an upstream block but connections still churn. What else must be configured, and how do you size the pool?
hardProxying 9 mins60. In limit_req, what exactly do burst, nodelay and delay do to a bursty client, and how do you choose between them?
hardTraffic Control 9 mins61. How do you size worker_processes and worker_connections for a reverse-proxy workload, and why is the naive maths wrong?
hardPerformance 10 mins