Web / NGINX Interview questions
What is the difference between NGINX and Apache HTTP Server?
Both are mature, widely used web servers, but they differ fundamentally in how they handle connections and configuration.
| NGINX | Apache |
| Event-driven, asynchronous architecture; a fixed number of workers handle many connections. | Traditionally process- or thread-per-connection (prefork/worker MPMs), though the event MPM narrows this gap. |
| Excels at serving static content and acting as a reverse proxy/load balancer. | Strong dynamic module support, including embedded language interpreters like mod_php. |
| Configuration is centralized and doesn't support per-directory .htaccess files. | Supports .htaccess for per-directory overrides without restarting the server. |
| Lower memory use under high concurrency. | Higher memory use per connection at scale, but a very flexible module ecosystem. |
In practice, many stacks use both together: NGINX at the edge as a reverse proxy and static file server, with Apache behind it handling dynamic application logic.
More Related questions...