Unable to get subdomain correct url when running locally

30 Views Asked by At

In the process of a building an Angular application, this application will have multiple subdomains so

client1.mysite.com client2.mysite.com client3.mysite.com

I have the following in my host file:

127.0.0.1 localhost
::1       client1.mysite.com

and I run the Angular app as so:

ng serve --host client1.mysite.com --port 4200 --open 

which opens the url of

http://client1.mysite.com:4200/

When I try to grab the url within the Web API by doing:

var requestingUrl = HttpContext.Request.Host;

It gives me

localhost:4200

I was expecting to see client1.mysite.com, does anyone know why I can't get the client1.mysite.com in my web API

0

There are 0 best solutions below