Reputation: 11
apache logs 200 (success) code but browser shows 504 Gateway timeout error for the same request.
Also, it times out just after aws load balancer idle time out value which is 1200 (20mins).
I do not find any log entries for the requests which times out (504) in the load balancer access logs.
I have tried increasing aws load balancer idle timeout value from 600 to 1200. but still times out.
Am I missing anything to troubleshoot? Any clue of what can be happening?
Additional info
504 error in the browser. 504 gateway timeout error in the browser
200 success code logged in the apache access log.
[14/Sep/2023:13:12:18 +1000] "GET /pages/UI.php?operation=details&class=UserRequest&id=581400& HTTP/1.1" 200 202228
Below is load balancer health check running periodically which is 200 code.
[14/Sep/2023:13:46:26 +1000] "GET /pages/UI.php HTTP/1.1" 200 9540 "-" "ELB-HealthChecker/2.0"
Upvotes: 1
Views: 617
Reputation: 5259
I'm willing to bet you're NOT allowing traffic to your instance beyond your load balancer. The fact that the ELB can grab that page but the browser can't is what tells me that. Theres a number of things that can cause this but below I list the two that are most common for me and below that I give a simple SSH test if you want to quickly confirm its either of these. My money is on your ELB listener is configured improperly or your security group for the ELB and or EC2 instance is not correct either.
Load balancer listener configuration
You might not have a listener configured for your ELB that listens on port 443 as well as 80. You can check your listener configuration in the EC2 or load balancer settings.
Security group configuration
The other source could be you have a security group for your load balancer that is not allowing "ingress" on port 443 or 80. You can check that in the EC2 security group settings.
Another way to confirm network block(Optional if you dont want to check the settings above)
If you're comfortable with SSH, you can confirm one of these quickly by SSHing onto your EC2 instance then use curl to request your page from the commandline. If you get content back then its one of the problems above.
curl command(Do this on the EC2 instance after SSHing into it)
curl -k -L https//localhost:${port}/pages/UI.php?operation=details&class=UserRequest&id=581400
If all of that still doesn't produce any results and your getting 504 on the EC2 I'd like to know more about your infrastructure/architecture setup. Good luck.
Upvotes: 0