Hello @Huy Sy Doi ,
Apologies for the delay in my response as I was checking all the configuration and also trying to reproduce this setup in my lab.
So, below are my findings:
For the TLS connection to work, you need to ensure that the TLS/SSL certificate meets the following conditions:
- That the current date and time is within the "Valid from" and "Valid to" date range on the certificate.
- That the certificate's "Common Name" (CN) matches the host header in the request. For example, if the client is making a request to https://www.contoso.com/, then the CN must be www.contoso.com.
- Refer: https://learn.microsoft.com/en-us/azure/application-gateway/ssl-overview
When you enable end-to-end SSL on Azure Application gateway v2, below is the live traffic behavior:
If the backend pool address is an IP address or hostname isn't set in HTTP settings, SNI will be set as the hostname from the input FQDN from the client and the backend certificate's CN has to match with this hostname.
Refer: https://learn.microsoft.com/en-us/azure/application-gateway/ssl-overview#for-live-traffic
Also, if you check the below doc, it says the Common Name (CN) of the backend certificate should match the host header of the custom probe.
Now, in your setup, the certificate used by you has a Common Name (CN): kofax-VN01CSUC17-CA and this is added correctly in your custom health probe (as I can see from the screenshot shared by you before) but you are trying to access the Application gateway with its IP address which doesn't match the CN of the backend certificate.
And hence, you are seeing the backend healthy, but the Application gateway is failing with error 502.
To fix this issue, my recommendations are as below:
- Point your Application gateway's IP address to domain "kofax-VN01CSUC17-CA", if possible and use the same to access the App gateway.
OR
- If it is not possible to point the Application gateway, then try a hostname override in your backend HTTP settings to "kofax-VN01CSUC17-CA" as below and check if it works.
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.