TR EN

HTTP 502 Bad Gateway

HTTP 502 Bad Gateway indicates that the server, while acting as a gateway or proxy, received an invalid response from the inbound server.

502

HTTP 502 Bad Gateway

HTTP RFC Standard

What Does HTTP 502 Mean?

HTTP 502 Bad Gateway indicates that the server, while acting as a gateway or proxy, received an invalid response from the inbound server.

Causes and How to Fix HTTP 502

Crashed backend processes (PHP-FPM, Gunicorn, Node.js), out-of-memory errors, or reverse proxy misconfigurations.

SEO & Search Engine Crawl Impact

502 means a gateway did not receive a valid upstream response. Check service health, connectivity and configuration before deciding whether a restart is appropriate.

Testing HTTP 502 via Terminal (cURL)

Inspect the HTTP response status and headers directly from your terminal:

curl -I -L https://example.com
curl -s -o /dev/null -w "%{http_code}\n" https://example.com

Web Server Configuration (Nginx & Apache)

Configure custom error handling in your web server:

# Nginx Custom Error Handler
error_page 502 /502.html;
location = /502.html {
    root /var/www/html;
    internal;
}

Other HTTP Status Codes

HTTP 200HTTP 301HTTP 302HTTP 400HTTP 401HTTP 403HTTP 404HTTP 410HTTP 429HTTP 500HTTP 503HTTP 504

Google: HTTP status codes and crawling

Frequently Asked Questions

How do I fix an HTTP 502 status code?
Crashed backend processes (PHP-FPM, Gunicorn, Node.js), out-of-memory errors, or reverse proxy misconfigurations. Check server error logs (/var/log/nginx/error.log) and verify application route handlers.
Does HTTP 502 affect my SEO rankings?
502 means a gateway did not receive a valid upstream response. Check service health, connectivity and configuration before deciding whether a restart is appropriate.