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

asked a year ago361 views
2 Answers
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
EXPERT
answered a year ago
  • 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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions