
How AI Can Help Your Business Grow
Read Full ArticleYears in Business
Projects Delivered
Client Relationships
Countries Served
Assisting brands to make a digital impact.
Assisting brands to make a digital impact.
Assisting brands to make a digital impact.
Assisting brands to make a digital impact.
Assisting brands to make a digital impact.
How we diagnosed an intermittent AWS Application Load Balancer failure in an Ubuntu, Plesk, Nginx, Apache, PHP-FPM and WordPress environment.
Application Load Balancer errors are confusing because a simple 502 Bad Gateway can originate from AWS ALB, Security Groups, Network ACLs, Plesk, Nginx, Apache, PHP-FPM, WordPress, Fail2Ban, iptables or ModSecurity.
This guide explains a practical investigation flow for identifying where the failure actually happens, without exposing any client name, domain, IP address or production infrastructure details.
Ubuntu Server, Plesk Obsidian, Nginx, Apache, PHP-FPM, WordPress
AWS EC2, Application Load Balancer, Target Groups, Security Groups, ENI
Users started seeing a public website error:
However, the Plesk panel was still accessible through an SSH tunnel:
This immediately raised an important question: was the issue really with Plesk, or somewhere between AWS ALB and the server?
First, check whether Nginx, Apache and PHP-FPM are running.
In Plesk environments, PHP-FPM may appear as a Plesk-specific service, for example:
Restart the web stack if needed:
If Plesk updates were stuck or web configuration appears inconsistent, run:
This checks and repairs Apache configuration, Nginx configuration, SSL assignments, PHP handlers and domain-level web configuration.
Check domain-level logs:
Also check the global Nginx error log:
Run a header test against the public website:
If the output shows:
Then the error is generated by AWS ALB, not directly by Plesk or WordPress.
Test the backend server directly using the private IP and Host header.
If the backend responds with 200 OK, it proves that Nginx, Apache, PHP-FPM and WordPress are working behind the load balancer.
Watch the domain access logs while refreshing the public website.
If the public website still shows 502 but no new log entry appears, it means the request is not reaching Plesk. The issue is likely at ALB, Target Group, Security Group, ENI, NACL or firewall level.
Do not use the WordPress homepage as the ALB health check. It may redirect, load plugins, hit the database or trigger security rules.
Test it:
Expected result:
Use a static health file instead of WordPress homepage.
In AWS, check:
Confirm that the correct EC2 instance or private IP is registered on the correct port.
Confirm protocol, port, path and success codes.
EC2 must allow HTTP/HTTPS traffic from the ALB Security Group.
Confirm that the ALB listener forwards to the correct target group.
| Error | Meaning | Common Cause |
|---|---|---|
| 502 Bad Gateway | ALB tried to reach the target but connection or response failed. | Wrong protocol, port, TLS issue, backend closed connection. |
| 503 Service Unavailable | ALB has no healthy target available. | Target removed, target unhealthy, listener has no healthy backend. |
If the target becomes healthy and then unhealthy again after a few minutes, investigate dynamic blocking tools such as Fail2Ban and iptables.
Fail2Ban is not part of WordPress. It is a Linux/Plesk security service that monitors logs and creates firewall rules through iptables.
Increased traffic alone does not normally break ALB. However, it can increase bot traffic, crawler activity, failed login attempts and security events.
| Check | Result | Interpretation |
|---|---|---|
| Plesk Panel | Working | Plesk service is healthy. |
| Direct backend curl | 200 OK | Nginx, Apache, PHP-FPM and WordPress are responding. |
| Public URL | 502 / 503 | Failure is likely before or inside ALB routing. |
| Plesk access logs | No new request | ALB request is not reaching the backend server. |
| Target Group | Unhealthy | Check health reason, Security Group, ENI, NACL and iptables. |
For most WordPress/Plesk websites behind ALB, the safest setup is:
This avoids backend TLS handshake issues between ALB and Plesk.
A 502 Bad Gateway does not always mean WordPress or Plesk is down. In this investigation, the backend was proven healthy through direct private IP testing, while public traffic failed at the AWS ALB layer.
The correct troubleshooting approach is to isolate every layer: public domain, ALB, target group, security groups, ENI, firewall rules, Nginx, Apache, PHP-FPM and WordPress.
The biggest lesson: always create a static health check endpoint and monitor Fail2Ban/iptables when using Plesk behind AWS ALB.