HTTP 300 Multiple Choices vs 502 Bad Gateway
HTTP 300 (Multiple Choices) is a 3xx Redirection response, while 502 (Bad Gateway) is a 5xx Server Error response. 300 indicates that the request has more than one possible response. The client should choose one of them. In contrast, 502 means that the server, acting as a gateway or proxy, received an invalid response from the upstream server.
Description
The request has more than one possible response. The client should choose one of them.
When You See It
When a resource is available in multiple formats (e.g., different languages or media types).
How to Fix
Select the appropriate resource variant. Send an Accept header with your preferred content type.
Description
The server, acting as a gateway or proxy, received an invalid response from the upstream server.
When You See It
When Nginx/Apache can't reach the application server (e.g., Gunicorn is down, upstream timeout).
How to Fix
Check if the upstream server is running. Verify proxy configuration. Check for upstream timeouts.
Key Differences
300 is a 3xx Redirection response, while 502 is a 5xx Server Error response.
HTTP 300: The request has more than one possible response. The client should choose one of them.
HTTP 502: The server, acting as a gateway or proxy, received an invalid response from the upstream server.
You encounter 300 when when a resource is available in multiple formats (e.g., different languages or media types).
You encounter 502 when when Nginx/Apache can't reach the application server (e.g., Gunicorn is down, upstream timeout).
When to Use Which
For 300 (Multiple Choices): Select the appropriate resource variant. Send an Accept header with your preferred content type. For 502 (Bad Gateway): Check if the upstream server is running. Verify proxy configuration. Check for upstream timeouts.