IIS Express包含所有子域的URL [英] IIS Express catch-all Subdomain url

查看:67
本文介绍了IIS Express包含所有子域的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找针对IIS Express中子域所有URL的解决方案.

I'm looking for a solution for a subdomain catch-all url in IIS Express.

基本上,我环顾四周,发现了如何在IIS Express中创建域/子域.

Basically, I've looked around and found how to create domains/subdomains in IIS Express.

这很容易找到,我所要做的就是在IIS Express的ApplicationHost.config中添加另一个绑定,然后更改主机文件以将127.0.0.1指向域.

It was quite easy to find, and all I had to do was add another binding in the ApplicationHost.config for IIS Express, and change my hosts file to point 127.0.0.1 to the domain.

这是IIS Express配置文件:

This is the IIS express config file:

<binding protocol="http" bindingInformation="*:80:domain.com" />
<binding protocol="http" bindingInformation="*:80:sub.domain.com" />

但是,我找不到任何方法来创建一个包罗万象的URL.我可能在某个地方对我视而不见,我什至尝试过(也许是天真的)*:80:*.domain.com*:80:*.

However, I couldn't find any way to create a catch-all URL. There might have been an over-sight from me somewhere, I even tried (maybe naively) *:80:*.domain.com and *:80:*.

我搜索过但无法解决的另一个问题是将IIS Express完全绑定到所有URL(例如,每个请求都应通过IIS Express传递给特定端口).

Another question that I've searched but couldn't an answer to is binding IIS express to a catch-all url completely (as in, every request should pass through IIS Express for a specific port).

如果有问题,我正在使用ASP.NET MVC 3应用程序.

If it matters I'm using an ASP.NET MVC 3 application.

推荐答案

不幸的是,我不认为这是可能的,因为IIS不支持通配符域.以下站点详细介绍了可能的解决方法.

Unfortunately, I don't believe this is possible, because IIS does not support wildcard domains. The following sites detail potential workarounds.

http://forums.iis.net/t/1095760.aspx

https://serverfault.com/questions/165660/wildcard-subdomains-on -localhost-using-iis7

IIS7中的通配符子域.是否可以使它们像Apache中一样?

以下文章解释了IIS绑定的工作方式.关于第二个问题,文章指出:

The following article explains how IIS bindings work. In relation to your second question, the article states:

最短的绑定是 保留给具有单个IP的服务器 和网站,或者如果您希望拥有一个 当没有其他绑定时,包罗万象"的网站 适合.此绑定,使用IP 通配符,没有主机头,将是 当没有其他应用时绝对适用 可以找到绑定匹配.在这个 绑定将简单地是:

The shortest possible binding is reserved for servers with a single IP and site, or if you wish to have a "catch-all" site when no other binding fits. This binding, which uses the IP wildcard and no host header, would be applied absolutely last when no other binding match could be found. In this case the binding will simply be:

http *:80:

http *:80:

这篇关于IIS Express包含所有子域的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆