NginX Load Balancer 504 Error
I’m experiencing difficulties connecting my Application Load Balancer (ALB) to my EC2 instance, which hosts a WordPress site using Nginx. Below is the setup and the issues I’m facing:
Infrastructure Overview:
- Web Server: EC2 Instance running WordPress with Nginx (listening only on port 443)
- Database: Hosted on RDS
- Content Storage: S3
Current Issues:
- When connecting Nginx to the load balancer, I receive a 504 Gateway Timeout error.
- If I configure Nginx to handle HTTP only (which I have avoided due to the ALB’s redirection), I receive a 502 Bad Gateway error.
Load Balancer Configuration:
- Inbound Rules:
- Source: 0.0.0.0/0, Port: 80 (HTTP)
- Source: 0.0.0.0/0, Port: 443 (HTTPS)
- Outbound Rules:
- Destination: 0.0.0.0/0, Port: All traffic
Auto Scaling Group Configuration:
- Inbound Rules:
- Source: application-load-balancer-sg, Port: 443 (HTTPS)
- Outbound Rules:
- Destination: 0.0.0.0/0, Port: All traffic
The load balancer has a redirect rule configured for HTTP to HTTPS. Could you please help me troubleshoot the cause of these errors? Any guidance on configuration adjustments or debugging steps would be greatly appreciated.
Thank you!
Read more here: Source link
