移动设备出现 HTTP 504 错误
我正在尝试调试为什么尝试连接到我的嵌入式 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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.
不,504 并不意味着您的网络服务器超时。这意味着中间代理在等待源服务器完成请求时超时。 “服务器在充当网关或代理时,没有收到来自 URI 指定的上游服务器的及时响应。” (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5)这很可能表明源服务器存在某种问题,因此它没有快速响应转发的请求。
可能的解决方案:
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: