如果 auth 服务器超时,则为 Http 状态代码

标签 http web http-status-code-503 http-status-code-504

假设我们正在从我们的服务器启动 oauth 流程,并且提供者超时。我们返回什么作为状态码? 503 表示稍后重试还是 504 表示其他服务器超时?

最佳答案

我认为 502 在这种情况下最合适

502 Bad Gateway

A 502 error means that a website server that is serving as a reverse proxy for the website origin server (for example, a CDN PoP) did not receive a valid response from the origin server. This may be because the origin server is experiencing issues, there is an invalid or incorrect DNS name, or because a firewall on the origin server has blocked the reverse proxy server request.

This may also occur when requests at the origin server are taking several minutes to complete and a caching tool such as Varnish Cache has been instructed to timeout after a set number of seconds. Varnish Cache has a default timeout of 60 seconds, which section.io recommends keeping for security and alerting reasons.

504 Gateway Timeout

Similar to the 502 error, the 504 Gateway Timeout error occurs if the server that is acting as a proxy for the website origin server did not receive a response from the website origin server within a set time period. This may indicate an issue with the DNS host or hosting company, or with the connection or configuration between the reverse proxy servers and the website origin server.

更多信息在这里 https://www.section.io/blog/504-503-errors-difference/

关于如果 auth 服务器超时,则为 Http 状态代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49828261/

相关文章:

python - django:通用类 View + POST = HTTP 405(不允许的方法)

html - 全尺寸 <main>,页脚推到底部

php - 全局更改日期格式

html - 我需要一些 12 div 的排列。我可以使用 HTML、CSS。我会展示代码和安排

Docker - 来自守护进程 : received unexpected HTTP status: 503 Service Unavailable 的错误响应

node.js - 在heroku上部署后无法读取mongo数据库,返回503错误,但在本地可以工作

html - 表单帖子中字段的大小限制是多少?

rest - 'Query String Parameters' 是 header 的一部分吗?

forms - Rails 7 + Turbo : Turbo navigates away when receiving 422 unprocessable entity

bash - cURL 结果为 503;页面在浏览器中工作正常。