As per recent statistics, websites adopting HTTP/2 protocol are rapidly increasing and around 68% of HTTPS traffic is now attributed to HTTP/2.
HTTP/2 uses techniques to minimize the number of connections and proactively serve page resources to improve site speed and performance.
But many customers who have their websites setup in AWS are stuck without being able to use HTTP/2, as its still not supported by default in AWS products.
Out of the different AWS products available, three commonly used ones are EC2, ELB and Cloudfront. We’ll see how to enable HTTP/2 support in them.
1. HTTP/2 support in AWS Cloudfront
Cloudfront is an AWS product which is aimed at speeding up the web site contents – html, images, media files – etc., to the end users. Cloudfront started supporting HTTP/2 now.
Enabling HTTP/2 for an existing CloudFront distribution can be done from the CloudFront Console. Identify the distribution, and click on Edit.
Update the ‘Supported HTTP Versions’ to include HTTP/2 support. This will enable HTTP/2 support for your Cloudfront instance when you access it with supported browsers.
2. HTTP/2 support in AWS ELB
ELB (Elastic Load Balancing) is a load balancer provided by AWS. Clients connect to the ELB, which distributes the traffic across multiple EC2 instances.
In ELB, there are processes known as ‘listeners’, that check for connection requests to the load balancer. It supports two types of protocols – TCP/SSL and HTTP/HTTPS.
Listener has a front-end port to accept connections from users to the load balancer and a back-end port to redirect the traffic to the back-end server.
ELB do not support HTTP/2 by default. But a work around is possible by configuring ELB with the TCP/SSL protocol and using NginX as the web server.
When TCP protocol is configured, the front-end load balancer in TCP mode, simply forwards the request to the back-end server without any header modification.
The ELB listener should be configured to allow TCP to listen to port 443 instead of HTTPS:
Load Balancer Protocol = TCP Load Balancer Port = 443 Instance Protocol = TCP Instance Port = 443
TCP protocol do not support cookies. This leads to session breakages and is hence not recommended for websites that require session stickiness, such as e-commerce or banking.
Read: How to setup secure WordPress hosting in AWS
3. HTTP/2 support in AWS EC2
EC2 refers to the Amazon webservers, that are used to host user websites. One of its major drawbacks is the lack of support for HTTP/2 by default.
As per the update from the AWS team, they are working on this feature but no ETA is mentioned. Users would have to keep waiting for an update from them.
Read: How to fix AWS WordPress update failures
In short..
Owing to its improved speed and performance compared to HTTP/1, HTTP/2 is fast gaining popularity among web users.
Not having HTTP/2 support by default in AWS can be a matter of concern for many. Here we discussed how HTTP/2 can be configured in AWS products.
For HTTP/2 to work, the web browsers and sites should support HTTPS (secure TLS) connections. The browser settings would have to be verified to confirm that.
Bobcares helps online businesses of all sizes achieve world-class security and uptime, using tried and tested solutions. If you’d like to know how to make your server infrastructure more efficient, we’d be happy to talk to you.
Debian Testing works correctly from a fresh install after enabling http2 (a2enmod http2).