0
0
Nginxdevops~20 mins

Proxy timeouts in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Proxy Timeout Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the effect of this nginx proxy timeout setting?
Given the nginx configuration snippet below, what will happen if the backend server takes longer than 10 seconds to respond?
Nginx
proxy_read_timeout 10s;
Anginx will wait indefinitely for the backend server to respond.
Bnginx will retry the request automatically to the backend server.
Cnginx will close the connection and return a 504 Gateway Timeout error to the client.
Dnginx will return a 502 Bad Gateway error immediately.
Attempts:
2 left
💡 Hint
Think about what 'proxy_read_timeout' controls in nginx.
Configuration
intermediate
2:00remaining
Which configuration sets the maximum time nginx waits to establish a connection to the backend?
Select the correct nginx directive to limit the time nginx waits to connect to the backend server.
Aproxy_connect_timeout 5s;
Bproxy_send_timeout 5s;
Cproxy_read_timeout 5s;
Dclient_body_timeout 5s;
Attempts:
2 left
💡 Hint
Connecting to backend is different from sending or reading data.
Troubleshoot
advanced
2:00remaining
Why does nginx return a 504 error despite a high proxy_read_timeout value?
An nginx server has proxy_read_timeout 120s; but clients still get 504 Gateway Timeout errors after 60 seconds. What is a likely cause?
AThe backend server closes the connection after 60 seconds.
BThe client closed the connection before 60 seconds.
CThe proxy_connect_timeout is set to 60 seconds.
DThe client_body_timeout is set to 60 seconds.
Attempts:
2 left
💡 Hint
Consider what controls the backend server's behavior.
Best Practice
advanced
2:00remaining
What is a recommended practice to avoid proxy timeout errors in nginx for slow backend responses?
Choose the best practice to handle slow backend responses without causing frequent 504 errors.
ASet proxy_connect_timeout to 1 second to fail fast.
BIncrease proxy_read_timeout to a value longer than the expected backend response time.
CDisable proxy_read_timeout to wait indefinitely.
DSet client_body_timeout to a very low value.
Attempts:
2 left
💡 Hint
Think about how to give backend enough time to respond.
🔀 Workflow
expert
3:00remaining
Order the steps to troubleshoot nginx proxy timeout errors effectively
Arrange the steps in the correct order to troubleshoot frequent 504 Gateway Timeout errors in nginx proxy setups.
A2,3,1,4
B1,3,2,4
C1,2,3,4
D3,2,1,4
Attempts:
2 left
💡 Hint
Start by understanding backend behavior before changing nginx settings.