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

17,121

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

Share:
17,121
Admin
Author by

Admin

Updated on June 03, 2022

Comments

  • Admin
    Admin about 2 years

    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

  • Kabir Sarin
    Kabir Sarin about 6 years
    omg I have been searching for this answer for one hour, why is it so obscurely documented?!
  • lsimonetti
    lsimonetti over 5 years
    This all of the sudden starting happening on one of my app servers. Would an update from LetsEncrypt or my SSL certs cause this?
  • lsimonetti
    lsimonetti over 5 years
    Actually, my issue wasnt SSL, it was the fact that some of the nginx files were owned by root user