- Newest
- Most votes
- Most comments
When you enable ALB target group protocol as HTTP/2 you need to make sure that target support protocol version HTTP/2 as well. For example if you are using nginx you can update server section as :
server {
listen 80 http2 ;
listen [::]:80 ;
If server is not configured to support protocol version, Target will send 400 bad request to ALB as ALB was making HTTP/2 request. Tested this on my env and packet capture on target show below response towards ALB.
PRI * HTTP/2.0
HTTP/1.1 400 Bad Request
Server: nginx/1.20.0
Date: Thu, 23 Feb 2023 05:06:42 GMT
Content-Type: text/html
Content-Length: 157
Connection: close
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.20.0</center>
</body>
</html>
Request packet from ALB to Target:
As the ALB get this 400 Bad request from target it can generate 502 back to the client.
If you have already configured your Target for HTTP2, then you can check other possible reasons for 502 here.
As far as performance , you can get the benefit of compressed header when you have end to end HTTP2, which can save some data transfer cost.
Relevant content
- Accepted Answerasked 2 years ago
- Accepted Answerasked 2 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago