Reputation: 45
I am facing an issue with App Gateway + Internal Load Balancer where path based routing is works perfectly but hostname base routing is not working which is define in ingress. Both the resources are in the same virtual network.
I have configured the public IP of the Application Gateway in the DNS Zone and routed all the traffic to the App Gateway listener.
Created App Gateway Listner with below host
host1 : cricket.mydomain.tech host2 : football.mydomain.tech
In AKS created nginx ingress controller and which automatically created internal load balancer and exposed below private IP, that IP i have confiuged in backend pool of listerner
In Ingress controller, did deployed below two ingress controller for Hello World application in AKS and generated hostname with certificates.
So when I am opening the the hostname with cricket.mydomain.tech it opens the hello-world-one and works perfectly but when I am opening the football.mydomain.tech it is not opening
Screen shot when opening http://cricket.mydomain.tech or http://cricket.mydomain.tech/hello-world-one both path gives proper result
Screen shot when opening http://football.mydomain.tech/hello-world-two or http://football.mydomain.tech both path gives bellow msg
Issue here is AKS Ingress controller is not routing traffic to second child domain with host name football.mydomain.tech or nginx is not picking up the proper domain which I am providing in hostname of listener. Can anyone please help here
I have followed below few article to configure this https://medium.com/@saifeddine.segni94/nginx-ingress-controllers-and-azure-app-gateway-for-azure-kubernetes-service-aks-f18c5be955d0
https://shuanglu1993.medium.com/application-gateway-work-with-aks-via-ssl-9894e7f4a587
Upvotes: 0
Views: 1419
Reputation: 5570
This error usually occurs if the gateway is unable to connect to the backend server or that the backend server returned an invalid response.
According to> MsDoc if you have multiple domain
contoso.com, Google.com,
point to the IP address of the application gateway. You'd create two multi-site listeners and configure each listener for the respective port and protocol setting.
Create two listeners with hostname like below:
Create 1 http setting like below:
Create two routing rule and add listener for each make sure to add backend target http setting for both routing rule like below:
Additionally, in your virtual network add service endpoint microsoft.web
with your application gateway subnet as like :
References:
Hosting multiple sites on Azure Application Gateway | Microsoft Learn
Troubleshoot Bad Gateway errors - Azure Application Gateway | Microsoft Learn
Upvotes: 0