如果代理完全没有响应,是否应该使用502 HTTP状态代码? [英] Should a 502 HTTP status code be used if a proxy receives no response at all?
问题描述
根据RFC:
10.5.3 502错误的网关
该服务器在充当网关或代理的同时,从尝试访问该请求的上游服务器接收到无效响应.
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)?
推荐答案
是.如果是通过网关或代理访问的,则通常是由断开的连接或服务器端崩溃导致的标头或响应主体为空或不完整,可能会导致502错误.
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
这篇关于如果代理完全没有响应,是否应该使用502 HTTP状态代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!