Application Load Balancer Path based Listener Error

0

I have created 4 EC-2 instances. Three of them in us-east-1c and one in use-east-1d.I have created two target groups with two instances each. I have created a simple html page in each server using putty and created application load balancer with default http to target group 1.

But when I want to divert to target group 2 using path base listener it shows URL not found 404 error.

I have created index.html file in each server root directory /var/www/html. When using ALB DNS name it displays target group 1 server i.e. server 1 and server2.

In root directory of server 3 and server 4 I created a random folder like images. When I assigned listener path to /images and forwarded to target group 2 i.e. server 3 and server 4 the URL shows not found.

What mistake am I doing here? Kindly explain

질문됨 일 년 전384회 조회
2개 답변
0

When you access 3 and 4 manually on the /images URL, does it have a default doucment in that directory that could be served back to the load balancer? Also does /images have the correct permissions for access? It may be a case that because you do not have an index.html in your /images folder (default document) the ALB is technically trying to perform a directory listing.

The ALB needs to be able to retrive a valid document(webpage) when accesing a folder. I would place a valid page that would be returned to the ALB or user in the images folder

The OTHER option is to add 404 as a Success code to the Target Group. This just means the webserver is responding but doesnt guarantee if your application is up or pages are not working

The 404 error means that the page being accessed doesnt exist on the webserver.. This points to my conclusion above

If this helps, please accept the answer so I know I have helped you, others and myself

profile picture
전문가
답변함 일 년 전
  • I created the image folder in both instances server 3 and server 4.Inside that I have kept a simple html page. The default load balancer dns returns server 1 and 2 in target groups.But when typing this "alb-server-239838479.us-east-1.elb.amazonaws.com/images/index.html it does not open shows the error.

  • I got it now brother

  • All sorted?

  • yes know its working fine brother. Thanks for the help

  • If you think my answer helped, It would be great to accept it.. Glad its working now

0

Change the listener path to /images/* and check

profile picture
Syd
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인