Don't want http 504's for idempotent requests

dstromberg nginx-forum at
Thu Jan 26 17:45:18 UTC 2017

Hi folks.

I have a REST API behind nginx.

Sometimes we get back an http 504 despite our software being up, and we
don't want that, at least not for idempotent requests.  We don't want 504's
for idempotent requests even if it means waiting a while for a response.

I'd look at the application to see what's taking too long, but it's actually
happening for a very simple health check of the API sometimes - all the
health check does is return a 200, nothing more.

We tried:

proxy_connect_timeout      600;
proxy_send_timeout         600;
proxy_read_timeout         600;
send_timeout               600;

proxy_next_upstream error;

http {
	keepalive_timeout 65;
	# We have 8 upstream servers defined.
	} no avail.

Also, I tried upgrading our nginx to 1.10.2 , but that didn't appear to help
- I'm still getting infrequent 504's.

I'm convinced we're getting 504's in less than 10 minutes, suggesting those
600 second timeouts aren't working as intended.

How can I eliminate http 504's for idempotent requests like GET?


Posted at Nginx Forum:,272154,272154#msg-272154

More information about the nginx mailing list