Troubleshooting guide
NGINX 502 Bad Gateway with PHP-FPM: Production Troubleshooting Guide
Find common causes of NGINX 502 Bad Gateway errors with PHP-FPM, including socket paths, service failures, permissions, timeouts and high load.
Troubleshooting guide
Find common causes of NGINX 502 Bad Gateway errors with PHP-FPM, including socket paths, service failures, permissions, timeouts and high load.
A 502 Bad Gateway from NGINX usually means NGINX could not get a valid response from the upstream service. With PHP sites, that upstream is often PHP-FPM, a Unix socket, or a TCP backend that is stopped, overloaded or misconfigured.
These checks are intended to help identify the direction of the issue. Always adjust paths, service names and commands for your environment.
tail -100 /var/log/nginx/error.logsystemctl status php*-fpm --no-pagerls -lah /run/php/ /var/run/php/ 2>/dev/nullfree -m && df -hGet help if the system is production-facing, customer data is involved, backups are uncertain, or the issue affects revenue, security or uptime. We can review the logs, confirm the cause and quote a fixed-scope fix where appropriate.
Need this fixed?
Fixed technical support starts from $499. Emergency incident support is $199/hr with a minimum window.