子域指向同一IIS中的不同网站 [英] Subdomain point to different websites in same IIS
本文介绍了子域指向同一IIS中的不同网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一台运行默认网站的IIS服务器,在/LandingPage路径中运行的react应用程序,在/api中由React应用程序使用的API,所以基本上,我有:
localhost:80/->默认的MVC网站
localhost:80/LandingPage-> React APP
localhost:80/api->应用要使用的API.
当前,我有一个指向服务器的域,因此可以从外部访问它,但是我想为APP/API创建一个子域,因此不需要在URL中看到/LandingPage./p>
我可以将子域设置为直接指向localhost:80/LandingPage吗?我应该在IIS上完成还是在DNS配置中完成?
基本上访问"app.domain.com"将直接指向"localhost:80/LandingPage",这可能吗?
谢谢!
解决方案
是的.您需要在IIS上创建虚拟服务器.我不是IIS方面的专家,但是涉及到:
- 为每个网站创建不同的文件夹.
- 在IIS管理器上创建两个不同的网站,并提供您的网络内容文件夹的路径.
- 绑定您的主机名.当您在站点下选择网站连接时,绑定选项将显示在右侧的操作选项卡下.
- 进入绑定屏幕后,单击添加.
- 在主机名字段中输入您的域名.
更多信息:
- Digicert有关如何使用以下命令配置主机名的指南屏幕截图 .
- 如何在IIS服务器中正确设置绑定.
-
Thank you!
解决方案Yes, it is. You need to create a virtual server on IIS. I'm no expert on IIS, but it involves:
- Creating different folders for each website.
- Creating two different Web Site on IIS Manager with the path to your web content folder.
- Bind your hostname. Bindings option will appear under Actions tab on the right side when you select your website connection under Sites.
- Once you get to the bindings screen, click Add.
- Enter your domain name in the Host name field.
More info:
- Digicert's guide on how to configure host names with screenshots.
- Microsoft's Documentation on Add/Edit Site Binding.
- How to properly set bindings in IIS server.
- Configure a Host Header for a Web Site (IIS 7)
这篇关于子域指向同一IIS中的不同网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文