Safari and Chrome Connection Issues on iPhone with http/2 via AWS Load Balancer

tom Tom, 13th February 2020

If you are having problems getting Safari and Chrome on iOS to connect to your site and you're using an AWS Application Load balancer, you might want to check if you have http/2 enabled on the load balancer. If you do, and you're using Apache, try adding the following line to your .htaccess file.

Header unset Upgrade

This tiny little line could make the difference between your site working and a large number of users being completely blocked from accessing it.

What's going on?

Http/2 is the brand new version of the protocol that the Internet runs on, and this major new release was launched back in 2015. It has loads of advantages over Http1.1 including performance and security. You can read all about it here in this very thorough article. Needless to say, it's a good thing if you can enable it on your site.

Why this weird issue with some browsers? This Stack Overflow post explains what's going on.

An endpoint MUST NOT generate an HTTP/2 message containing connection-specific header fields; any message containing connection-specific header fields MUST be treated as malformed (Section 8.1.2.6).... connection- specific header fields, such as Keep-Alive, Proxy-Connection, Transfer-Encoding, and Upgrade

So the workaround appears to just be to remove the Upgrade header set by Apache and just rely on the load balancer to handle things.

The above issue isn't always as obvious as you might think either as sometimes it's only certain images which don't load. We've certainly found in our office some of us with iPhones can see a site fine, whilst others have issues. The most recent time we came across the issue, iPhone 8 and iPhone 10 users had a problem whilst iPhone 11 and iPhone 8 Plus users were fine, but it doesn't always seem to be dependent on the model of iPhone or operating system. So if your users are asking "why doesn't your website work on safari on an iphone" or "why are images not showing on safari" or reporting "site not loading on chrome on my phone" then you might want to check out the above and test on a variety of phones to be sure as it does seem a little intermittent.

I hope that's some help to someone out there because it's certainly a strange one! 

Want to share? Tweet it!

More from our blog

5 ways we've used the web to combat the challenges of 2020

5 ways we've used the web to combat the challenges of 2020

24.09.20

2020 has certainly been a very different sort of year. We've been thankful that for us - despite the team all working from home -… Read →

The 18a orchard in full bloom

The 18a orchard in full bloom

18.08.20

Over a decade ago we planted a small fruit orchard at Tom's parents house, planting a tree for every website we built in our first… Read →

Tom shortlisted for Agri-tech Innovator of the Year 2020

Tom shortlisted for Agri-tech Innovator of the Year 2020

14.08.20

We are very excited to be able to announce that 18a's CTO Tom Freeman has been shortlisted for the British Farming Awards' Agri-tech Innovator of… Read →