移动设备出现 HTTP 504 错误

发布于 2024-08-02 22:41:27 字数 120 浏览 3 评论 0原文

我正在尝试调试为什么尝试连接到我的嵌入式 Web 服务器的移动设备收到“HTTP 504 错误:网关超时”。 PC 可以正常连接,只有黑莓和手机会出现此错误。

504 错误是什么意思?
我能做什么呢?

I am trying to debug why a mobile device trying to connect to my embedded web server is getting a "HTTP 504 Error: Gateway timeout". A PC can connect just fine, it's just the Blackberries and mobile phones that get this error.

What does a 504 error mean?
What can I do about it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故笙诉离歌 2024-08-09 22:41:27

HTTP 状态代码 504 表示您的网络服务器超时。此消息可能是由于您的服务提供商的路由器/网关速度较慢而引起的,但也有可能您的嵌入式网络服务器对您的手机反应较慢(反之亦然,尽管这种情况不太可能发生)。

您可能需要尝试使用 wlan 连接而不是 3G 将手机连接到网络服务器,看看是否存在此问题。

编辑类型:
您可能会考虑将调试输出实现到您的网络服务器。此外,使超时参数可配置也很有用。

HTTP status code 504 means that your webserver got a timeout. This message might be caused because of a slow router/gateway of your service provider, but it is also possible that your embedded webserver reacts to slow for your phones (or vice versa, even though this is very unlikely).

You might want to try connecting with your phone(s) to your webserver using a wlan-connection instead of 3G to see if this problem consist.

Sort of EDIT:
You might consider implementing debugging output to your webserver. Also it could be useful to make the timeout-parameters configurable.

世俗缘 2024-08-09 22:41:27

不,504 并不意味着您的网络服务器超时。这意味着中间代理在等待源服务器完成请求时超时。 “服务器在充当网关或代理时,没有收到来自 URI 指定的上游服务器的及时响应。” (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5)这很可能表明源服务器存在某种问题,因此它没有快速响应转发的请求。

可能的解决方案:

  • 找出使用什么代理来处理黑莓请求;增加其超时值。
  • 检查代理是否以任何方式改变您的请求;由于 PC 可以连接,因此请求可能正在更改。
  • 以不同的方式提出您的请求(如果可能),以便您一次请求更少的数据

No, 504 doesn't mean that your webserver timed out. It means that an intermediate proxy timed out while waiting for the origin server to complete the request. "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI." (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5) It most likely indicates that the origin server is having some sort of issue, so it's not responding quickly to the forwarded request.

Possible solutions:

  • Find out what proxy is used to handle Blackberry requests; increase its timeout value.
  • Check to see if the proxy is altering your request in any way; since a PC can connect, it may be that the request is being altered.
  • Make your request differently (if possible) such that you are requesting less data at a time
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文