简体   繁体   中英

How to connect aws load balance (ELB) to node port 8081

I have 2 EC2 instance where my node app running on 8081 port

webserver 1 

http://ec2-3-17-133-60.us-east-2.compute.amazonaws.com:8081/

and

webserver 2

http://ec2-3-14-71-215.us-east-2.compute.amazonaws.com:8081/

Now I am trying to connect it from load balancer

My configured for this load balancer:

Load Balancer Protocol -> HTTP

Load Balancer Port -> 80

Instance Protocol -> HTTP

Instance Port -> 8081

Cipher -> N/A

SSL Certificate -> N/A

but when I try to open my elb url

http://myfirstelb-1516157627.us-east-2.elb.amazonaws.com/

Nothing happens and ended with

internal error - server connection terminated

What is i am missing here ?

The first step to verify is to check the target group of your Load Balancer. Go to the target group and verify targets and health checks.

在此处输入图片说明

Here you will see the status if it's not healthy then Backend not responding to LB,

One reason, Security group not allowing traffic from the port 8081 .

Another reason the ping path does not exist

Create a target page for the health check and specify its path as the ping path.

在此处输入图片说明

This ping should return 200

The connection times out

First, verify that you can connect to the target directly from within the network using the private IP address of the target and the health check protocol. If you can't connect, check whether the instance is over-utilized, and add more targets to your target group if it is too busy to respond. If you can connect, it is possible that the target page is not responding before the health check timeout period. Choose a simpler target page for the health check or adjust the health check settings.

The target did not return a successful response code

By default, the success code is 200, but you can optionally specify additional success codes when you configure health checks. Confirm the success codes that the load balancer is expecting and that your application is configured to return these codes on success.

Your Internet-facing load balancer is attached to a private subnet

Verify that you specified public subnets for your load balancer. A public subnet has a route to the Internet Gateway for your virtual private cloud (VPC).

A security group or network ACL does not allow traffic

The security group for the load balancer and any network ACLs for the load balancer subnets must allow inbound traffic from the clients and outbound traffic to the clients on the listener ports.

Here is the what you can get from AWS documentation

HTTP 500: Internal Server Error Possible causes:

You configured an AWS WAF web access control list (web ACL) and there was an error executing the web ACL rules.

You configured a listener rule to authenticate users, but one of the following is true:

  • The load balancer is unable to communicate with the IdP token endpoint or the IdP user info endpoint. Verify that the security groups for your load balancer and the network ACLs for your VPC allow outbound access to these endpoints. Verify that your VPC has internet access. If you have an internal-facing load balancer, use a NAT gateway to enable internet access.

  • The size of the claims returned by the IdP exceeded the maximum size supported by the load balancer.

  • A client submitted an HTTP/1.0 request without a host header, and the load balancer was unable to generate a redirect URL.

  • A client submitted a request without an HTTP protocol, and the load balancer was unable to generate a redirect URL.

  • The requested scope doesn't return an ID token.

AWS LB http-500-issues

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