An Illusion
An Illusion

Reputation: 777

AWS - How to set HTTP 502 timeout?

We have an elasticbeanstalk application that runs an api. Now the requests to the API frequently expected to take tens of seconds to be satisfied. I used to get an http 504 Gateway_Timeout for the requests after 60s of sending the requests.

enter image description here

So I set the 'Idle timeout' of the load balancer to 1800s.

enter image description here

Now I get an http 502 Proxy Error after 60s:

enter image description here

How do I fix it so that even if requests take longer than 60s I do not get an http 500 error?

Any advise is appreciated. Thank you.

Upvotes: 2

Views: 1053

Answers (2)

user602525
user602525

Reputation: 3254

I suspect it is not the elastic load balancer at all, but the HTTP server that resides in the container of the elastic beanstalk environment.

You need to configure the timeout of this server. This can usually be done with ".ebextensions" files. You can essentially replace the default httpd file with your own custom file using this method.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html

Upvotes: 1

Related Questions