1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [502 Bad Gateway](<https://delaparra-services.nl/knowledge-hub/502-bad-gateway>)

  

Category: HTTP status codes 

# 502 Bad Gateway

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is 502 Bad Gateway?

 

502 Bad Gateway: The server was acting as a gateway and received an invalid response from upstream. 502 Bad Gateway means a server that sits in front of your application, such as a load balancer, reverse proxy or CDN, received an invalid response from the application behind it. In practice it usually means the application process crashed, was restarting, or is not listening where the proxy expects. During a deploy you may see a short burst of 502s while old processes stop and new ones start.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about 502 Bad Gateway

  

### What should you keep in mind with 502 Bad Gateway?

 

To debug it, look one step further back. The proxy's own logs tell you which upstream failed, and the application or container logs tell you why. Common causes are a crashed PHP-FPM or Node process, a container that fails its start command, or a wrong port in the proxy configuration. Zero-downtime deploys and health checks prevent most of the deploy-time 502s.

 

## At a glance

   CategoryHTTP status codes Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More HTTP status codes terms

 

- [409 Conflict](<https://delaparra-services.nl/knowledge-hub/409-conflict>) 
- [422 Unprocessable Entity](<https://delaparra-services.nl/knowledge-hub/422-unprocessable-entity>) 
- [429 Too Many Requests](<https://delaparra-services.nl/knowledge-hub/429-too-many-requests>) 
- [500 Internal Server Error](<https://delaparra-services.nl/knowledge-hub/500-internal-server-error>) 
- [503 Service Unavailable](<https://delaparra-services.nl/knowledge-hub/503-service-unavailable>) 
- [504 Gateway Timeout](<https://delaparra-services.nl/knowledge-hub/504-gateway-timeout>)

 

[All terms starting with a number or symbol](<https://delaparra-services.nl/knowledge-hub#letter-other>)

 

## Skills

 

- ### HTTP status debugging

 

Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like "419 Page Expired", "422 Unprocessable Content", "502 Bad Gateway" or "CORS error", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.

 [View skill](<https://delaparra-services.nl/skills/http-status-debugging>) [Download zip](<https://delaparra-services.nl/skills/http-status-debugging/download>) 
- ### Systematic Debugging

 

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

 [View skill](<https://delaparra-services.nl/skills/systematic-debugging>) [Download zip](<https://delaparra-services.nl/skills/systematic-debugging/download>) 
- ### Sentry PHP SDK

 

Full Sentry SDK setup for PHP. Use when asked to "add Sentry to PHP", "install sentry/sentry", "setup Sentry in PHP", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for PHP applications. Supports plain PHP, Laravel, and Symfony.

 [View skill](<https://delaparra-services.nl/skills/sentry-php-sdk>) [Download zip](<https://delaparra-services.nl/skills/sentry-php-sdk/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/502-bad-gateway/skills.zip>)

 

## Manuals

 

- [Reading HTTP status codes and debugging API errors](<https://delaparra-services.nl/manuals/http-statuscodes-en-api-fouten>) 
- [Deploying a Laravel app](<https://delaparra-services.nl/manuals/je-laravel-app-online-zetten>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet. 
- [AI code review](<https://delaparra-services.nl/services#service-05>)

When you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/502-bad-gateway)
