Which statement correctly describes how Nginx and Apache handle client connections?
Think about how each server manages multiple requests at the same time.
Nginx uses an event-driven model that handles many connections efficiently with fewer resources. Apache traditionally uses a process or thread per connection, which can be less efficient under heavy load.
What is the output of the following command on a server running Nginx?
ps aux | grep nginx | grep -v grep
Consider how Nginx manages its processes.
Nginx runs one master process and multiple worker processes to handle requests. The command lists all these processes except the grep command itself.
Which Nginx configuration snippet correctly sets up a simple round-robin load balancer for two backend servers?
Look for the standard way to define upstream servers and proxy pass.
Option D correctly defines an upstream block with two servers and proxies requests to it. Option D adds weights which is valid but changes load balancing behavior. Option D and D have syntax errors or invalid directives.
You have Nginx configured as a reverse proxy to an application server. When accessing the site, you get a 502 Bad Gateway error. Which is the most likely cause?
502 means Nginx cannot get a valid response from the backend.
A 502 Bad Gateway error usually means Nginx tried to connect to the backend server but failed because it is down or unreachable. Configuration syntax errors cause startup failures, not 502 errors. Port mismatch is a cause but is covered by unreachable backend. Browser cache does not cause 502.
Which Nginx configuration snippet best improves performance by efficiently serving static files?
Think about caching headers and direct file serving.
Option A sets caching headers and serves files directly from disk, improving performance. Option A proxies static files to backend, which is inefficient. Option A disables caching. Option A denies access to static files.