英文:
Why do we get HTTP 503 service unavailable?
问题
我知道HTTP 503意味着"服务器不可用",如mozilla文档中所述。但是,如果服务器不可用或离线,那么那个服务器怎么能够返回503响应?是客户端超时并假设为503吗?
更新 -
我了解到通常会有"中间人",比如负载均衡器,当后端停止运行时会返回503。那么,如果没有中间人呢?在那种情况下,会得到HTTP 408吗?
英文:
I know that http 503 means that the "server is unavailable" as mentioned in mozilla docs. But, if the server is unavailable or offline, then how is that server able to return a 503 response ? Is the client getting timed out and assuming a 503?
UPDATE -
I learned that there is often "middle man" such as a load balancer which gives the 503 when the backend is down. So, what if there is no middle man? Would you get an http 408 in that case?
PS - Java and Python tags are added only to get more attention from developers who are likely to know the answer to this question.
答案1
得分: 2
"50x"错误是应用程序错误。这意味着如果你有例如Apache2或Nginx Web服务器,并且该服务器与当前不可用(宕机、启动中、冻结等)的后端应用程序通信,你会收到这个503错误。
> 你 -----> Apache2/Nginx Web服务器 ------> 应用程序后端 = 你会得到200
> 响应。
> 你 -----> Apache2/Nginx Web服务器 --XXX--> 应用程序后端 = 你会得到503
> 错误。
英文:
50x
errors are for application errors. This means that if you have for example Apache2 or Nginx web server and that server communicate with backend application which is currently unavailable (down, starting, freezed, etc) you get this 503 error.
> YOU -----> Apache2/Nginx web server ------> app backend = you will get 200
> response.
> YOU -----> Apache2/Nginx web server --XXX--> app backend = you will get 503
> error.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论