Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should a 502 HTTP status code be used if a proxy receives no response at all?

According to the RFC:

10.5.3 502 Bad Gateway
The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

Can invalid response also mean no response at all (e.g. connection refused)?

like image 288
primroot Avatar asked Feb 16 '11 01:02

primroot


People also ask

When should I use HTTP 502?

The HyperText Transfer Protocol (HTTP) 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server. So stick with the right server status response code for the right situation.

What is a 502 HTTP status?

An HTTP 502 status code (Bad Gateway) indicates that CloudFront wasn't able to serve the requested object because it couldn't connect to the origin server.

What causes a 502 proxy error?

The HTTP 502 - bad gateway error occurs when either: The timeout of the proxy was reached prior to the request completion. If the connection proxy > server drops. When the response from the server is invalid.

What does proxy server received an invalid response from an upstream server mean?

This means that a server (not necessarily a web server) acting as a gateway or proxy and received an invalid response from an upstream (or origin) server. In most cases the problem is not with you computer or your internet connection , it's far more likely that it's the website's server instead.


1 Answers

Yes. Empty or incomplete headers or response body typically caused by broken connections or server side crash can cause 502 errors if accessed via a gateway or proxy.

For more information about the network errors

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

like image 111
blinkingled Avatar answered Sep 20 '22 21:09

blinkingled