|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<configuration> |
| 3 | + <system.webServer> |
| 4 | + <staticContent> |
| 5 | + <remove fileExtension=".dll" /> |
| 6 | + <remove fileExtension=".json" /> |
| 7 | + <remove fileExtension=".wasm" /> |
| 8 | + <remove fileExtension=".woff" /> |
| 9 | + <remove fileExtension=".woff2" /> |
| 10 | + <remove fileExtension=".js.gz" /> |
| 11 | + <remove fileExtension=".dll.gz" /> |
| 12 | + <remove fileExtension=".json.gz" /> |
| 13 | + <remove fileExtension=".wasm.gz" /> |
| 14 | + <remove fileExtension=".js.br" /> |
| 15 | + <remove fileExtension=".dll.br" /> |
| 16 | + <remove fileExtension=".json.br" /> |
| 17 | + <remove fileExtension=".wasm.br" /> |
| 18 | + <mimeMap fileExtension=".dll" mimeType="application/octet-stream" /> |
| 19 | + <mimeMap fileExtension=".json" mimeType="application/json" /> |
| 20 | + <mimeMap fileExtension=".wasm" mimeType="application/wasm" /> |
| 21 | + <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> |
| 22 | + <mimeMap fileExtension=".woff2" mimeType="application/font-woff" /> |
| 23 | + <mimeMap fileExtension=".js.gz" mimeType="application/javascript" /> |
| 24 | + <mimeMap fileExtension=".dll.gz" mimeType="application/octet-stream" /> |
| 25 | + <mimeMap fileExtension=".json.gz" mimeType="application/json" /> |
| 26 | + <mimeMap fileExtension=".wasm.gz" mimeType="application/wasm" /> |
| 27 | + <mimeMap fileExtension=".js.br" mimeType="application/javascript" /> |
| 28 | + <mimeMap fileExtension=".dll.br" mimeType="application/octet-stream" /> |
| 29 | + <mimeMap fileExtension=".json.br" mimeType="application/json" /> |
| 30 | + <mimeMap fileExtension=".wasm.br" mimeType="application/wasm" /> |
| 31 | + </staticContent> |
| 32 | + <httpCompression> |
| 33 | + <dynamicTypes> |
| 34 | + <remove mimeType="application/javascript" /> |
| 35 | + <remove mimeType="application/json" /> |
| 36 | + <remove mimeType="application/octet-stream" /> |
| 37 | + <remove mimeType="application/wasm" /> |
| 38 | + </dynamicTypes> |
| 39 | + <staticTypes> |
| 40 | + <remove mimeType="application/javascript" /> |
| 41 | + <remove mimeType="application/json" /> |
| 42 | + <remove mimeType="application/octet-stream" /> |
| 43 | + <remove mimeType="application/wasm" /> |
| 44 | + </staticTypes> |
| 45 | + </httpCompression> |
| 46 | + <rewrite> |
| 47 | + <outboundRules rewriteBeforeCache="true"> |
| 48 | + <rule name="Add Vary Accept-Encoding" preCondition="PreCompressedFile" enabled="true"> |
| 49 | + <match serverVariable="RESPONSE_Vary" pattern=".*" /> |
| 50 | + <action type="Rewrite" value="Accept-Encoding" /> |
| 51 | + </rule> |
| 52 | + <rule name="Add Encoding Brotli" preCondition="PreCompressedBrotli" enabled="true" stopProcessing="true"> |
| 53 | + <match serverVariable="RESPONSE_Content_Encoding" pattern=".*" /> |
| 54 | + <action type="Rewrite" value="br" /> |
| 55 | + </rule> |
| 56 | + <rule name="Add Encoding Gzip" preCondition="PreCompressedGzip" enabled="true" stopProcessing="true"> |
| 57 | + <match serverVariable="RESPONSE_Content_Encoding" pattern=".*" /> |
| 58 | + <action type="Rewrite" value="gzip" /> |
| 59 | + </rule> |
| 60 | + <preConditions> |
| 61 | + <preCondition name="PreCompressedFile"> |
| 62 | + <add input="{HTTP_URL}" pattern="\.(gz|br)$" /> |
| 63 | + </preCondition> |
| 64 | + <preCondition name="PreCompressedGzip"> |
| 65 | + <add input="{HTTP_URL}" pattern="\.gz$" /> |
| 66 | + </preCondition> |
| 67 | + <preCondition name="PreCompressedBrotli"> |
| 68 | + <add input="{HTTP_URL}" pattern="\.br$" /> |
| 69 | + </preCondition> |
| 70 | + </preConditions> |
| 71 | + </outboundRules> |
| 72 | + <rules> |
| 73 | + <rule name="Serve subdir"> |
| 74 | + <match url=".*" /> |
| 75 | + <action type="Rewrite" url="wwwroot\{R:0}" /> |
| 76 | + </rule> |
| 77 | + <rule name="Rewrite brotli file" stopProcessing="true"> |
| 78 | + <match url="(.*)"/> |
| 79 | + <conditions> |
| 80 | + <add input="{HTTP_ACCEPT_ENCODING}" pattern="br" /> |
| 81 | + <add input="{REQUEST_FILENAME}.br" matchType="IsFile" /> |
| 82 | + </conditions> |
| 83 | + <action type="Rewrite" url="{R:1}.br" /> |
| 84 | + </rule> |
| 85 | + <rule name="Rewrite gzip file" stopProcessing="true"> |
| 86 | + <match url="(.*)"/> |
| 87 | + <conditions> |
| 88 | + <add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> |
| 89 | + <add input="{REQUEST_FILENAME}.gz" matchType="IsFile" /> |
| 90 | + </conditions> |
| 91 | + <action type="Rewrite" url="{R:1}.gz" /> |
| 92 | + </rule> |
| 93 | + <rule name="SPA fallback routing" stopProcessing="true"> |
| 94 | + <match url=".*" /> |
| 95 | + <conditions logicalGrouping="MatchAll"> |
| 96 | + <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> |
| 97 | + </conditions> |
| 98 | + <action type="Rewrite" url="wwwroot\" /> |
| 99 | + </rule> |
| 100 | + </rules> |
| 101 | + </rewrite> |
| 102 | + </system.webServer> |
| 103 | +</configuration> |
0 commit comments