且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 iis7 中将 http://localhost:8080 映射到 http://mysites?

更新时间:2023-01-17 23:08:10

如前所述,您可以编辑 hosts 文件(或更新本地 DNS 服务器),使名称指向所需的 IP 地址.当名称中没有 DOT 时,某些浏览器会遇到 cookie 问题,因此您可能需要执行 mysites.localmysites.ivor

As stated before, you can edit the hosts file (or update a local DNS server), so that the names point to the desired ip addresses. Some browsers have trouble with cookies when there's no DOT in the name, so you may want to do something like mysites.local or mysites.ivor

如果在端口 80 上运行其他东西,您必须配置该服务器以代理对 IIS 的请求(在端口 80 上).如果您无法在端口 80 上运行任何东西,您可以配置名称,但最后您仍然需要该端口.

If there's something else running on port 80, You have to configure that server to proxy the requests to IIS (on port 80). If you can't run anything on port 80, you can configure the names, but you'll still need the port at the end.

如果只有 IIS 正在运行,您可以使用虚拟主机进行设置.您在端口 80 上将 IP 地址的绑定添加到您指定的 DNS 名称.只要它们具有不同的主机名,您就可以在一个端口上运行它们.

If only IIS is running, you can set this up by using virtual hosts. You add a binding to the IP address, on port 80, to the DNS name you specified. You can run them all on one port as long as they have different host names.