HTTP 404 error from ALB

0

I have an ALB with a target group with two EC2 instances running Apache with a simple hello world index.html. Both the instances are healthy and accessible using their public IP. If I configure the listener default rule to the target group it works fine. But if I configure the same target group using a path based rule like '/product', it gives 404 error. What can go wrong?

Velu
已提問 9 個月前檢視次數 752 次
2 個答案
0
已接受的答案

Setting a path based rule like /product simply means that any request that has a URI ending in /product would now be forwarded to your target group. It does not rewrite the URI.

Your Apache Server presumably would not have a document to serve for http://<your-domain/product and therefore returns a 404 to the ALB.

AWS
專家
已回答 9 個月前
profile picture
專家
已審閱 9 個月前
profile pictureAWS
專家
已審閱 9 個月前
0

Hello.
Is there a directory named "/product" in your target EC2 path?
If there is no content in this directory, a 404 error will be generated.

profile picture
專家
已回答 9 個月前
profile pictureAWS
專家
已審閱 9 個月前
  • I understand your answer also means the same but I couldn't understand immediately. With additonal information from Max's answer it was a bit clearer. Thanks anyway.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南