Nginx – What might cause ERR_CONNECTION_CLOSED on a mobile network but not WiFi

nginxsslweb-server

A small number of our users are unable to access our website via a mobile connection, but can on WiFi.

It seems to only affect Android, regardless of the browser type, and the same customers can access the site via a different Android. It's only on a mobile connection, but works on WiFi on the same device. It's not simply that the signal is bad.

The error is: 'This site can't be reached …unexpectedly closed the connection. ERR_CONNECTION_CLOSED'

We're using HSTS and ssllabs ssltest gives us A+. It's served by nginx.

Any suggestions what might be causing this? We're flummoxed. Thank you!

Best Answer

The most likely explanation is that something is messed up in the mobile carrier's network.

You first need to test through different mobile carriers to see if you are able to reproduce the problem on more than one. My guess is that if you try through a few different carriers you will also find one where it works.

You should also try both OS on the carrier where the problem is seen most frequently to verify if there is a difference between the OS when both used on the same network.

If you find that only one carrier (or a few) is affected and only one OS can reproduce the problem, the next step will be to find out what is the difference between the packets generated by each OS.

A first experiment is to compare the traffic generated by your application using each OS both connected to a WiFi access point under your own control. That way you can capture packets and compare them.

It is theoretically possible that the difference in the generated traffic only manifests itself on cellular networks and not on WiFi. If that is the case try to find a carrier without the problem and inspect the traffic from server side while attempting connections from each OS.

I also suggest you verify if the problem persists when one phone connected to cellular network acts as hotspot and the second phone connects using WiFi to the first phone. Verify all four possible combination of OS on the phones acting as hotspot and client.

Another thing to watch out for is IPv6 support on the website. Some mobile carriers are now using IPv6-only networks and if your website doesn't support it yet clients may be relying on NAT64 which you can't expect to be as reliable as a direct end-to-end connection.

If your website does not yet have IPv6 support, you should test if enabling IPv6 support improves the situation.

Related Topic