How to configure the application gateway for 2 domains?

Gregorio Montaño 251 Reputation points
2023-09-05T10:45:54.56+00:00

Hi,

I have 2 websites with different domains that point to the same application gateway.
Let us call website1 as domain1.com and website2 as domain2.com.
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 http://domain2.com redirects to https://domain1.com without any issue but
accessing website2 as https://domain2.com displays the message on the Chrome browser

NET::ERR_CERT_COMMON_NAME_INVALID

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

Thanks.

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

Accepted answer
  1. ChaitanyaNaykodi-MSFT 25,611 Reputation points Microsoft Employee
    2023-09-09T04:12:35.83+00:00

    @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 https://domain2.com 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

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.