Safari ajax请求无法加载资源:网络连接丢失 [英] Safari ajax request Failed to load resource: The network connection was lost
问题描述
我收到消息 无法加载资源:网络连接丢失." ,该应用程序使用ajax请求从服务器获取内容.此错误仅在Safari中有效,其他浏览器都可以.
I'm receiving a message "Failed to load resource: The network connection was lost." in my application, which uses ajax requests to get content from server. This error is only in Safari, other browsers are ok.
我搜索了最近几个小时,发现可能是由于http标头导致的:
I was searching last few hours and found that it can be due to http headers:
传输编码:分块
连接:保持活动状态
内容长度
Transfer-Encoding : chunked
Connection: keep-alive
Content-Length
我发现了类似的内容: https://github.com/woothemes/woocommerce/issues /7176 底部告诉他们设置了
I've found something similar: https://github.com/woothemes/woocommerce/issues/7176 On the bottom is told that they set
浏览器匹配"Safari"浏览器
在.htaccess中.
BrowserMatch "Safari" nokeepalive
in .htaccess.
nginx服务器是否有类似的解决方案或设置?
Is there any similar solution or settings for nginx server?
谢谢
JF
推荐答案
之所以可能发生,原因之一是Safari处理某些SSL证书(主要是LetsEncrypt)的方式.解决的办法是把线:
One of the reasons why it might happen is the way Safari handles some SSL certificates (mainly, LetsEncrypt). The solution is to put the line:
ssl_session_cache shared:SSL:10m;
到您的nginx配置.
to your nginx config.
来源: https://community .letsencrypt.org/t/apple-safari-browsers-fail-to-connect/3731/3
这篇关于Safari ajax请求无法加载资源:网络连接丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!