Why is Cloudfront using https (http over tls) to origin instead of http2 ?


I have enabled http2 on cloudfront and alb.Below is an access log from alb.

https 2022-04-14T12:07:34.438950Z app/awseb-AWSEB-@#$$$$$$$/33c31cf831229bd5 0.001 0.059 0.000 200 200 1091 15561 "GET https://mywebsite.co:443/ HTTP/1.1" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 arn:aws:elasticloadbalancing:us-east-1:123456789:targetgroup/awseb-AWSEB-CO4F476RJ4O0/e54f61d50c1c75c9 "Root=1-62580e86-1411f5a823d9bc5f7dc1df7e" "mywebsite.co" "session-reused" 0 2022-04-14T12:07:34.378000Z "forward" "-" "-" "" "200" "-" "-"

As you can see cloudfront is using https i.e http over tls instead of http2.
What could be the issue ?

1 Answer
Accepted Answer

Kindly note that CloudFront is currently not supporting HTTP/2 towards origins. The connection from CloudFront back to your origin server is still made using HTTP/1.1:

New – HTTP/2 Support for Amazon CloudFront - https://aws.amazon.com/blogs/aws/new-http2-support-for-cloudfront/ HTTP version - https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#RequestCustomHTTPVersion

answered 2 years ago
profile picture
reviewed 3 months ago
  • Ohh, okk.
    Hence was debugging an issue wherein our ttfb(time to first byte) is high when cloudfront is used compared to serving from alb directly.I asked a separate question here

  • If cloudfront supports http2 to origin, I think it helps a lot given cloudfront is at edge locations and a new connection to the origin server for most of the viewer requests increases latency.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions