简体   繁体   中英

How to forward port in AWS Application load balancer (ALB) port forwarding

Is it possible to have an application running on an EC2 instance and have a load balancer listen on port 80 but proxy it to the instances port 8080?

I cannot seem to get this to work. What setting to I need to change. I am running the cluster behind an application load balancer.

Adding answer with AWS management snippets .

Add the instance port in the target group, refer below image for it. for example i've added tomcat 8080 port to the target group port/

在此处输入图像描述

Make sure that your ELB is internet facing. refer below image of ELB summary , which says that my ELB is internet -facing. and check that your routing is properly added.

在此处输入图像描述

You define the instance port in the Target Group. You need to configure the Target Group to use port 8080. Then point the Application Load Balancer's port 80 listener to the Target Group. The ALB will listen on port 80, and forward requests to port 8080 on the Target Group instances.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM