我有以下规则,但当我访问 https:/myservermyappsparoute1。 我得到的是403,而不是index.html。
我在myapp的根目录下得到了这个配置。
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy to API" stopProcessing="true">
<match url="api/(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" url="https://internalserver/myapp/{R:0}" />
</rule>
<rule name="Reverse Proxy to Signalr" stopProcessing="true">
<match url="messagehub(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" url="https://internalserver/myapp/{R:0}" />
</rule>
<rule name="Handle History Mode for SPA (myapp)" stopProcessing="true">
<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="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
前两条规则都能用,但重写时没有返回默认的index.html,而是得到一个403。有什么好办法吗?
重写的url是相对于网站的,所以最后的操作应该是...
<action type="Rewrite" url="/myapp" />