http 500 错误总结
500: Internal server ErrorThe server encountered an unexpected condition which prevented it from fulfilling the request.应用代码出了问题,比如说空指针、数据库异常、访问其它服务的网络异常等等,被tomcat容器捕获后,返回500错误。501:Not ImplementedThe
500: Internal server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
应用代码出了问题,比如说空指针、数据库异常、访问其它服务的网络异常等等,被tomcat容器捕获后,返回500错误。
501: Not Implemented
The server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.
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.
比如nginx作为反向代理,在请求连接后端服务的时候失败了,nginx返回502,比如常见的如下场景(等等):
1.后端服务崩溃了,根本连不上,报connection refused错误等。
2.nigx去访问DNS服务起,获取uptream stream真正的地址,DNS没有配置映射。
3.后端服务的连接数满了,nginx无法与其建立新的连接。
4.后端服务架设了防火墙,导致nginx与其建立连接到时候失败。
5. 网络瘫痪,nginx无法与后端服务进行通信。
503 Service Unavailable
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.
出现这种问题主要有两个原因:
1.服务处于维护阶段,但不是当机。
2.举个例子,tomcat的worker已达上线,不能再处理更多的请求,会返回503。
504 Gateway Timeout
The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.
nginx设置了timeout时间,请求发送给上层服务,超过既定时间没有收到结果,nginx返回504
更多推荐
所有评论(0)