Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari ajax request Failed to load resource: The network connection was lost

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.

I was searching last few hours and found that it can be due to http headers:

Transfer-Encoding : chunked
Connection: keep-alive
Content-Length

I've found something similar: https://github.com/woothemes/woocommerce/issues/7176 On the bottom is told that they set

BrowserMatch "Safari" nokeepalive
in .htaccess.

Is there any similar solution or settings for nginx server?

Thank you

JF

like image 410
Jakub Formanek Avatar asked Nov 24 '15 13:11

Jakub Formanek


1 Answers

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;

to your nginx config.

Source: https://community.letsencrypt.org/t/apple-safari-browsers-fail-to-connect/3731/3

like image 175
Dmitry Semenyuk Avatar answered Nov 16 '22 00:11

Dmitry Semenyuk