简体   繁体   English

如何在IIS中使域名指向不同的端口而不是80?

[英]How to make domain name to point different port not 80 in IIS?

I have a domain just bought.我有一个刚买的域名。 Say it is: myowndomain.com.说它是:myowndomain.com。 I have added A record with my SERVER IP address.我已经用我的服务器 IP 地址添加了一条记录。 We have two applications on our server.我们的服务器上有两个应用程序。 One is with port 3000 and other is with port 3001.一个是 3000 端口,另一个是 3001 端口。

Now I would like to access my applications through this domain.现在我想通过这个域访问我的应用程序。 It is working now when I call it by myowndomain.com:3000 and myowndomain.com:3001.当我通过 myowndomain.com:3000 和 myowndomain.com:3001 调用它时,它现在正在工作。

How to setup the system to load port 3000's application if I call myowndomain.com and load 3001's application if I call my.myowndomain.com.如果我调用 myowndomain.com,如何设置系统加载端口 3000 的应用程序,如果我调用 my.myowndomain.com,如何加载 3001 的应用程序。 [subdomain my.myowndomain.com is also added in godaddy] 【godaddy中也添加子域my.myowndomain.com

Simple.简单的。 I just have to add domain name alias in HTTP binding and save.我只需要在 HTTP 绑定中添加域名别名并保存。

I think you need to do this by using URL Rewriting.我认为您需要通过使用 URL 重写来做到这一点。 Please have a look on below link from iis, here is given complete demo how you can do this:请查看以下来自 iis 的链接,这里给出了完整的演示,您可以如何做到这一点:

https://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module https://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

you can install ur rewriting from here:你可以从这里安装你的重写:

https://www.iis.net/downloads/microsoft/url-rewrite https://www.iis.net/downloads/microsoft/url-rewrite

by using this on your applications you can move individual pages also to a specific url.通过在您的应用程序上使用它,您还可以将单个页面移动到特定的 url。 hopefully it will resolve your problem.希望它能解决你的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM