proxy_read_timeout 10s;The proxy_read_timeout directive sets the time nginx will wait to receive a response from the backend server. If the backend takes longer than this time, nginx closes the connection and returns a 504 Gateway Timeout error.
proxy_connect_timeout sets the timeout for establishing a connection to the backend server. Other timeouts control sending or reading data.
proxy_read_timeout 120s; but clients still get 504 Gateway Timeout errors after 60 seconds. What is a likely cause?If the backend server closes the connection early, nginx cannot receive data and returns a 504 error even if its timeout is longer.
Increasing proxy_read_timeout allows nginx to wait longer for slow backend responses, reducing 504 errors. Other options either cause premature failures or are unrelated.
First test backend response times, then check backend logs, next review nginx timeout settings, and finally adjust nginx configuration accordingly.