0
0
Nginxdevops~5 mins

502 Bad Gateway troubleshooting in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AThe client sent a bad request
BNginx server is overloaded
CNginx cannot reach the upstream server or got a bad response
DDNS resolution failed
Which nginx directive sets the upstream server address?
Aproxy_pass
Bserver_name
Clisten
Droot
If you see a 502 error, what is a good first step to troubleshoot?
ARestart the client browser
BCheck if the upstream server is running and reachable
CChange DNS settings
DClear nginx cache
Where do you find nginx error messages related to 502 errors?
A/var/log/nginx/error.log
B/usr/share/nginx/html/index.html
C/etc/nginx/nginx.conf
D/var/log/nginx/access.log
Which command can you use to test connectivity to the upstream server?
Achmod
Bls
Ccat
Dcurl
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.