shinek
shinek

Reputation: 251

504 Gateway Time-out on ALB

I created an EC2 instance with apache installed on it and allowed HTTP/SSH traffic for my system only. I was able to access Web page using public IP of EC2. Then I configured ALB with same SG, registered same EC2 instance with ALB. Tried to access Web page using DNS name of ALB, got error -504 Gateway Time-out.

Increased time out interval to see if this resolves issue, didn't work. Then I revisited lesson and thought lets allow HTTP traffic to everyone(since it was allowed in lecture) in SG to see if it works and YES, it worked. I again changed SG to allow traffic only for my system and it failed again.

Upvotes: 5

Views: 9539

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 179442

In this configuration, your security group needs to allow traffic from itself -- create rules that allow the appropriate ports, but use the security group sg-xxxx in place of an IP address, as the source. Merely being members of the same security group does not allow two systems to communicate with each other.

A better configuration would be for the balancer to have its own security group, and your instance's group would allow traffic from the balancer's group.

Note also that without the security group configuration being correct, you should also find that the health checks on the balancer are failing.

Upvotes: 10

Related Questions