Browse Source

Add rewrite rules for getEnvConfig in Web.config for Angular deployment

pull/23091/head
maliming 8 months ago
parent
commit
099a6b10d5
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 30
      docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md

30
docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md

@ -254,6 +254,36 @@ We can visit the websites from a browser.
![Tiered IIS deployment](../../../images/iis-sample-tiered-deployment.gif)
{{ if UI == "NG" }}
## Rewrite for getEnvConfig
Please add the following rewrite rules to your `Web.config` file to redirect requests for `getEnvConfig` to `dynamic-env.json`, See [Angular RemoteEnvironment](https://abp.io/docs/latest/framework/ui/angular/environment#remoteenvironment) for more details.
```xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url="getEnvConfig" />
<action type="Redirect" url="dynamic-env.json" />
</rule>
<rule name="Angular Routes" 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="./index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
```
{{ end }}
## Fix 405 Method Not Allowed Error
Remove `WebDAV` modules and handlers from the `Web.config` file.

Loading…
Cancel
Save