0

We've been testing Elastic Beanstalk against a misbehaving web app (that we, alas, have no control over). Sometimes it takes longer than 60 seconds before sending the first bytes of a response, but at the 60 second mark the app sends a 504: Gateway Timeout message from nginx.

We need to set that 60 seconds to something higher. We tried adding these settings to a file that we send to "aws eb create-environment..."

{ "Namespace": "aws:elb:policies:myPolicy",
"OptionName": "ConnectionSettingIdleTimeout", "Value": "300" }

But they don't seem to affect the 60 second timeout. What are we doing wrong?

Scott Ross
  • 123
  • 1
  • 7

1 Answers1

1

The reported error could be from your ELB, but more often than not it's from Nginx. In the former case, you can raise the IdleTimeout to a higher limit using AWS CLI:

# Modify ELB idle-timeout
aws elb modify-load-balancer-attributes --load-balancer-name <myloadbalancer> --load-balancer-attributes "{\"ConnectionSettings\":{\"IdleTimeout\":180}}"

In the latter case, consider raising the keepalive_timeout limit in nginx.conf within the http block similar to the following, then restart it (sudo service nginx restart):

http {
  // ...
  keepalive_timeout 180s;
}
Leo C
  • 22,006
  • 3
  • 26
  • 39
  • fantastic. Do you know handy how to specify the ngnix timeout via eb extensions? – Scott Ross May 03 '17 at 00:44
  • No, unfortunately. I did all the configurative tuning of Nginx and ELB without using `ebextensions`. Maybe examples in this [link](https://medium.com/trisfera/getting-to-know-and-love-aws-elastic-beanstalk-configuration-files-ebextensions-9a4502a26e3c) will be of interest to you. – Leo C May 03 '17 at 01:19