Questions tagged with Application Load Balancer

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

GRPC API through AWS ALB

Hi, I'm trying to run a netty server with GRPC API on ECS (on Fargate) behind an application load balancer for an Android GRPC client to connect to. Calls are forwarded but the server logs show an error like ``` io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 1603010102010000fe03036a5663244616ee784100b9d61c ``` I've read that such an error might be related to the client and server not both using SSL, which arguably is true in my case. The server itself is not configured to use SSL (I wouldn't know which certificate to deploy it with). The ALB is equipped with an ACM public certificate though and should do SSL offloading I would expect. However, the fact that I cannot configure the load balancing target group with another protocol than HTTPS when protocol version is GRPC indicates otherwise. Can anyone clarify this to me or have a working example? Any help would be much appreciated This is the relevant ALB config of my cfn template: ```yaml ApplicationLoadBalancer: Type: "AWS::ElasticLoadBalancingV2::LoadBalancer" Properties: Name: my-alb Scheme: "internet-facing" Type: "application" Subnets: - !Ref public-sn-1 - !Ref public-sn-2 SecurityGroups: - !Ref ALBSecurityGroup IpAddressType: "ipv4" HubListener: Type: "AWS::ElasticLoadBalancingV2::Listener" Properties: LoadBalancerArn: !Ref ApplicationLoadBalancer Port: 50051 Protocol: HTTPS SslPolicy: "ELBSecurityPolicy-2016-08" Certificates: - CertificateArn: !Ref AlbCertificateArn DefaultActions: - Order: 1 TargetGroupArn: !Ref HubTargetGroup Type: "forward" HubTargetGroup: Type: "AWS::ElasticLoadBalancingV2::TargetGroup" Properties: Port: 50051 Protocol: HTTPS ProtocolVersion: GRPC HealthCheckEnabled: true HealthCheckPath: "/grpc.health.v1.Health/Check" HealthCheckPort: "traffic-port" HealthCheckProtocol: HTTP TargetType: ip Matcher: GrpcCode: 0 VpcId: !Ref VpcId ```
1
answers
1
votes
372
views
asked 5 months ago

Launch Announcement - New ALB enhancements provide options to specify how to process Host header and X-Forwarded-For header

We are happy to announce that we just launched two enhancements to define how the Application Load Balancer (ALB) will process *Host* header and *X-Forwarded-For* header. These options provide additional flexibility in handling HTTP/HTTPS requests and allow customers to migrate their workloads to ALB. *Background:* AWS customers had asked for flexibility in specifying how ALB would handle Host and X-Forwarded-For headers in HTTP/HTTPS Requests. The enhancements are as follows: *Host Header Enhancement:* * Currently, ALB modifies Host header in the incoming HTTP/HTTPS Request, and appends listener port before sending it to targets. For example, the Host: www.amazon.com header in the HTTP Request is modified to Host: www.amazon.com:8443 before ALB sends it to targets. This will remain the default behavior for backward compatibility. * With this enhancement, when enabled using a new attribute, ALB will send the Host header without any modification to the target. For example, the Host: www.amazon.com header in the HTTP Request will not be modified and sent to target as is. *X-Forwarded-For Header Enhancement:* * Currently, ALB appends IP address of the previous hop to the X-Forwarded-For header before forwarding it to targets. This will remain the default behavior for backward compatibility. * With this enhancement, customers can now specify whether the ALB should preserve or delete the X-Forwarded-For header before sending it to the targets. *Launch Details:* * Both enhancements do not change the default behavior and existing ALBs are not affected. * The enhancements are available using API and AWS Console. * The enhancements are available in all commercial, GovCloud, and China regions. These will be deployed in ADC regions at a later date based on demand. *Launch Materials:* * Documentation for Host header enhancement - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#host-header-preservation * Documentation for X-Forwarded-For header enhancement - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html#x-forwarded-for Please give these enhancement a try. Thank you.
0
answers
4
votes
673
views
profile picture
EXPERT
asked 5 months ago