HTTP 303 See Other vs 502 Bad Gateway
HTTP 303 (See Other) is a 3xx Redirection response, while 502 (Bad Gateway) is a 5xx Server Error response. 303 indicates that the server is redirecting to a different resource using GET, typically after a POST operation (Post/Redirect/Get pattern). In contrast, 502 means that the server, acting as a gateway or proxy, received an invalid response from the upstream server.
Description
The server is redirecting to a different resource using GET, typically after a POST operation (Post/Redirect/Get pattern).
When You See It
After form submissions to prevent resubmission on browser refresh.
How to Fix
Follow the Location header with a GET request. This is intentional — part of the PRG pattern.
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
303 is a 3xx Redirection response, while 502 is a 5xx Server Error response.
HTTP 303: The server is redirecting to a different resource using GET, typically after a POST operation (Post/Redirect/Get pattern).
HTTP 502: The server, acting as a gateway or proxy, received an invalid response from the upstream server.
You encounter 303 when after form submissions to prevent resubmission on browser refresh.
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 303 (See Other): Follow the Location header with a GET request. This is intentional — part of the PRG pattern. For 502 (Bad Gateway): Check if the upstream server is running. Verify proxy configuration. Check for upstream timeouts.