How to configure the application gateway for 2 domains?

Gregorio Montaño 171 Reputation points


I have 2 websites with different domains that point to the same application gateway.
Let us call website1 as and website2 as
Both websites (website1 and website2) hit the same backend VM running an HTTPServer.
For website2, HTTPServer is configured to just redirect to website1.

Now, a user accessing website2 as redirects to without any issue but
accessing website2 as displays the message on the Chrome browser


How best to configure application gateway and/or HTTPServer to resolve this error message?


Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
781 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 15,806 Reputation points Microsoft Employee

    @Gregorio Montaño

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.

    Issue: You were experiencing an issue with configuring an application gateway for two domains. The HTTPServer is configured to redirect website2 to website1, and accessing website2 as displays the message "NET::ERR_CERT_COMMON_NAME_INVALID" on the Chrome browser.

    Solution: The solution in this case was to use multi-site HTTP(S) listener. Multiple site hosting enables you to configure more than one web application on the same port of application gateways using public-facing listeners. It allows you to configure a more efficient topology for your deployments by adding up to 100+ websites to one application gateway. You followed this tutorial to configure listeners and rules based on two domains to make sure web traffic arrives at the appropriate servers in the pools.

    If you have any other questions or are still running into more issues, please let me know.

    Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution

    0 comments No comments