Recall & Review
beginner
What does a 502 Bad Gateway error indicate in nginx?
It means nginx received an invalid response from the upstream server it tried to contact.
Click to reveal answer
beginner
Name two common causes of a 502 Bad Gateway error in nginx.
1. The upstream server is down or unreachable.<br>2. The upstream server is overloaded or crashing.
Click to reveal answer
intermediate
Which nginx configuration directive specifies the upstream server address?
The
proxy_pass directive inside a location block tells nginx where to send requests.Click to reveal answer
beginner
How can you check if the upstream server is reachable from the nginx server?
Use commands like
curl or telnet to test connection to the upstream server's IP and port.Click to reveal answer
intermediate
What nginx log files help diagnose 502 Bad Gateway errors?
The
error.log file usually contains detailed error messages about upstream failures.Click to reveal answer
What does a 502 Bad Gateway error mean in nginx?
✗ Incorrect
A 502 error means nginx tried to contact the upstream server but got an invalid or no response.
Which nginx directive sets the upstream server address?
✗ Incorrect
The proxy_pass directive tells nginx where to forward requests.
If you see a 502 error, what is a good first step to troubleshoot?
✗ Incorrect
The upstream server might be down or unreachable, causing the 502 error.
Where do you find nginx error messages related to 502 errors?
✗ Incorrect
The error.log file contains detailed error messages.
Which command can you use to test connectivity to the upstream server?
✗ Incorrect
curl can test if the upstream server responds on the expected port.
Explain the main reasons why nginx might return a 502 Bad Gateway error and how you would check for them.
Think about the connection between nginx and the server it forwards requests to.
You got /5 concepts.
Describe how to use nginx configuration to specify the upstream server and how misconfiguration can cause 502 errors.
Focus on the proxy_pass setting inside location blocks.
You got /4 concepts.