How does a Windows server distinguish between 2 host names being directed by DNS to the same IP address?
I started a new job recently. We have files.example.com pointing to x.x.x.x IP address. I got asked to direct git.example.com also to x.x.x.x in a way such that the server can distinguish which site the requests come from.
I did my best to understand for the past couple of hours by searching Google uncontrollably. I used ambiguous names for the sake of anonymity of the pages I am working with.
From what I got so far: the Windows server can be set up to do HTTPS redirects that have status codes. There is a log of these on the server. I found one post mentioning that the HTTP 1.1 protocol includes a header called host which specifies which particular page a client is trying to access. How do you have one IP address and many websites? - ServerFault
So if I understand correctly, the server can distinguish between the 2 domains based on these host headers?
I feel like this is not the complete answer. In this case, just setting up redirects on the server should suffice since the server can already distinguish between the 2 pages, or is there another way?