【发布时间】:2018-01-23 22:03:05
【问题描述】:
我认为这应该是一项相当容易的任务,但我不知何故为此而苦苦挣扎。
我想做什么:
mydomain.ch -> should redirect to a simple html page in folder public
demo.mydomain.ch -> should redirect to a angular application
demo.mydomain.ch/api -> is the backend (express.js) for the angular application
我的文件夹/文件结构
web.config
demo
-> simplepage.html
-> index.html
-> angular.js
-> ...
backend
-> server.js
这是我当前的规则集:
<rule name="mydomain.ch rule" stopProcessing="true">
<match url="^mydomain\.ch$" />
<action type="Rewrite" url="demo/simplepage.html"/>
</rule>
<rule name="Root rule">
<match url="^$" />
<action type="Rewrite" url="demo/index.html"/>
</rule>
<!-- For static files, redirect to the URI -->
<rule name="Static files">
<action type="Rewrite" url="demo{REQUEST_URI}"/>
</rule>
<!-- For Express.js middleware API, if using api/ prefix, then use server.js -->
<rule name="Express.js URIs">
<match url="api/*"/>
<action type="Rewrite" url="backend/server.js"/>
</rule>
<!-- For Angular.js URIs, rewrite to the index.html file -->
<rule name="Angular">
<match url=".*"/>
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="demo/index.html"/>
</rule>
目前发生的情况是,对 mydomain.ch 或 demo.mydomain.ch 的每次调用都被重定向到 Angular 应用程序。要将 mydomain.ch 重定向到 simplepage.html,我需要进行哪些更改?
【问题讨论】:
标签: azure iis web-config azure-web-app-service