I have a website with several tenants that should take care of any incoming request and determine the appropriate routing by subdomain URL.
I configured subdomain routing using this or a similar solution.
However, I am trying to access my site on my local machine using subdomains on the alias website. I canβt connect the local IIS to the port on my site with the specified subdomain.
I want to dedicate a virtual domain name on my local computer, which will be transferred to the website where I am debugging VS ( localhost:23456 ).
I read several answers to the same questions (like this or this ), but it looks like the system has changed with the new configuration of the IIS project and Visual Studio 2015 and ASP.NET 5 MVC 6 (vNext).
Here is what I tried according to the answers above:
- I tried to transfer the
hosts www.myexample.com to 127.0.0.1 , but when I try to go to www.myexample.com:23456 in the browser, I get a "Bad request" message, and in any case, the debugger does not report the request. - I tried setting
<binding protocol="http" bindingInformation=":23456:www.myexample.com" /> in the applicationhost.config file to get the error message "Replace hostname with localhost". Any other bindingInformation does not specify localhost because the site is causing an IIS error.
Update
After the opponents answer
I knew about the .vs folder, and I configured the bindings really. However, it looked like it was a permission that caused IIS to throw errors. Running this netsh command solved the problem. And BTW, since I use only my own machine, I will not need to open the firewall.
In any case, my question is, is there a way to add a wildcard instead of each subdomain separately? As each tenant receives a unique subdomain, the whole process of adding subdomains will be dynamic in nature. I need to enable an asterisk in all three places:
- host file
- file applicationhost.config
- netsh team
It looks like I can add an asterisk in these places, but actually it does not work.
source share