Browse Source
Add rewrite rules for getEnvConfig in Web.config for Angular deployment
pull/23091/head
maliming
8 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
30 additions and
0 deletions
docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md
@ -254,6 +254,36 @@ We can visit the websites from a browser.

{{ 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.