502
HTTP 502 Bad Gateway
5xx Server Error
- Home
- > HTTP Status Codes >
- > 5xx >
- 502
Blog
Encoder & Decoder
Utility
General
- SMS Counter
- Check String Length
- Password Generator
- CHMOD Calculator
- Cron Job Command Generator
- Shortened URL Checker
- RGB to HEX Converter
- Epoch Unix Timestamp Converter
- UUID & ULID Generator
- Timezone Converter
Image Tools
PDF Tools
Minifier
Web Dev
- QR Code Generator
- Barcode Generator
- Lorem Ipsum Generator
- HTML Entities
- MIME Types Table Reference
- HTTP Status Codes
- What Is My IP Address
- JSON Formatter & Validator
- SQL Formatter & Beautifier
- XML Formatter & Beautifier
- YAML Formatter & Beautifier
- Text Case Converter
- JSON to CSV Converter
- Clipboard Workspace
- JSON Validator & Repair
- JSON Schema Validator
Laravel
- All Laravel Tools
- Collection Playground
- Eloquent Relationship Generator
- Validation Rule Generator
- Migration Generator
- Scheduler Generator
- Middleware Pipeline Visualizer
- Eloquent Query Builder Generator
- Laravel Artisan Cheat Sheet
Tailwind
5xx Server Error
RFC 7231, Section 6.6.3
What is HTTP 502 Bad Gateway?
The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an upstream server. This commonly occurs when a web server (like Nginx) receives an invalid or no response from an application server (like PHP-FPM, uWSGI, or a reverse proxy target).
Common Use Cases
- Application server crash behind reverse proxy
- Upstream service timeout
- PHP-FPM process unavailability
- Load balancer with unhealthy backend