Proxy Redirects to old site fail quite often for iOS browsers safari and chrome

Hello

We released a new webpage hosted on Netlify and proxying to our previous react application hosted on heroku. Everything seems to work fine but when a user using an iOS device navigates to a page 60-90% of the time it will flash the old site and fail to load the page fully and I get the console error
Failed to load resource: The network connection was lost.

And redirects the user to a “safari cannot open the page because the network connection was lost”
Chrome has the same thing happen but with the message “This site can’t be reached” and “website unexpectedly closed the connection”

The Header that failed looks like this

Proxying Charles looks like this:

|Status|Failed|
|---|---|
|Failure|EOF|
|Response Code|200|
|Protocol|HTTP/2.0|
|TLS|TLSv1.2 (TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256)|
|Protocol|TLSv1.2|
|Session Resumed|N/A (Connection kept alive)|
|Cipher Suite|TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256|
|ALPN|h2|
|Client Certificates|-|
|Server Certificates|4|
|Extensions||
|Method|GET|
|Kept Alive|Yes|
|Content-Type|text/html; charset=utf-8|
|Client Address|
|Remote Address|<redacted>
|Connection||
|WebSockets|-|
|Timing||
|Request Start Time|1/2/20 13:19:32|
|Request End Time|1/2/20 13:19:32|
|Response Start Time|1/2/20 13:19:33|
|Response End Time|1/2/20 13:19:33|
|Duration|783 ms|
|DNS|-|
|Connect|-|
|TLS Handshake|-|
|Request|1 ms|
|Response|57 ms|
|Latency|725 ms|
|Speed|220.33 KB/s|
|Request Speed|8.79 KB/s|
|Response Speed|2.96 MB/s|
|Size||
|Request|9 bytes|
|Response|172.51 KB (176,651 bytes)|

I will note that this does not happen with the Brave browser on iOS

I have been able to replicate this issue with iOS 12.3 and 13.2 and 13.3

Does anyone see a similar behavior when using the proxy? We checked our heroku logs and there are no errors in the requests/responses to the proxy so it seems to us to be entirely within the proxy

Thanks for writing in. I’ve responded to the helpdesk case you submitted and will continue to respond to you there. I appreciate the details and we’ll help figure out why this is happening.

What turned out to be the issue with this one? I ask because I’m getting more or less the same issue (“The network connection was lost.”) particularly on mobile Safari, and particularly on media files (mp4 video in my case). The difference is I don’t have any proxying going on.

Opening a support ticket now – though I can also DM our site name if that would help. Thanks!

Hi, @mfan. The issue in the topic above was that the proxy target was using Transfer-Encoding: chunked and HTTP/1.1.

By default our service uses HTTP/2 and HTTP/2 doesn’t support chunked as a transfer encoding type. It is a known issue that using our service to proxy to an target that uses Transfer-Encoding: chunked doesn’t work.

The workarounds for this are:

a) to configure the proxy target not use to chunked encoding
or
b) do not proxy to that target using Netlify

There is no other solution at this time. We do have an open issue filed for this so if we do start supporting proxying to targets using chunked encoding we will post an update here to let you know.