0

I have 2 different websites:

  • mysite.com
  • api.mysite.com

I want to be able to serve both of these websites from the same webserver (same IP) and same port number.

I have followed this document, and created the following websites:

enter image description here

This is how the binding for mysite.com looks like:

enter image description here

And this is how the binding for api.mysite.com looks like:

enter image description here

Note that the only way I could define 2 sites using the same IP and Port was to use a Host name for one of them.

With the above settings, mysite.com works but api.mysite.com does not work. If I stop mysite.com from IIS, then api.mysite.com starts working.

The document that I used as a guide explains that I need to use dnsmgmt.msc to define a CNAME for api.mysite.com, but here is where I am confused. I am using AWS and I have defined 2 CNAME records for these websites in Route 53. Do I still need to define a CNAME record for one of these websites in Windows?

If not, then how would I tell IIS that request containing api.mysite.com should be sent to website having the host name = api.mysite.com?

Update

The answer provided by Greg suggests that I would add mysite.com as Host name as well. If I follow this solution, how would I handle requests for www.mysite.com?

At the moment, any request for mysite.com is permanently redirected to www.mysite.com

1 Answer 1

2

Add mysite.com to the binding for that site to match the similar configuration for api.mysite.com

My guess is that the mysite.com one is matching the request condition for api.mysite.com (just port 80).

2
  • Thanks for your answer. Do you know how should I handle www.mysite.com? I have updated the question. Apr 4 at 1:50
  • 1
    You don’t have a www.mysite.com configuration on your server, based on your screenshots. Do you want both mysite.com and www.mysite.com to be the same site? If so, you can just add a second binding for mysite.com that has www.mysite.com as a host name.
    – Greg W
    Apr 4 at 6:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .