Advertisement
Guest User

Angular IIS

a guest
Sep 12th, 2024
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.66 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.   <system.webServer>
  4.     <staticContent>
  5.       <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
  6.     </staticContent>
  7.     <httpProtocol>
  8.       <customHeaders>
  9.         <clear/>
  10.         <add name="X-UA-Compatible" value="IE=EDGE" />
  11.       </customHeaders>
  12.     </httpProtocol>
  13.     <rewrite>
  14.       <rules>
  15.         <rule name="HTTP to HTTPS redirect" stopProcessing="true">
  16.           <match url="(.*)" />
  17.           <conditions>
  18.             <add input="{HTTPS}" pattern="OFF" ignoreCase="true" />
  19.           </conditions>
  20.           <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}{REQUEST_URI}" />
  21.         </rule>
  22.         <rule name="Angular Routes" stopProcessing="true">
  23.           <match url=".*" />
  24.           <conditions logicalGrouping="MatchAll">
  25.             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  26.             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  27.           </conditions>
  28.           <action type="Rewrite" url="/index.html" />
  29.         </rule>
  30.       </rules>
  31.       <outboundRules>
  32.         <rule name="RewriteCacheControlForHTMLFiles" preCondition="FileEndsWithHtml">
  33.           <match serverVariable="RESPONSE_Cache_Control" pattern=".*" />
  34.           <action type="Rewrite" value="no-store, max-age=0" />
  35.         </rule>
  36.         <preConditions>
  37.           <preCondition name="FileEndsWithHtml">
  38.             <add input="{REQUEST_FILENAME}" pattern="\.html$" />
  39.           </preCondition>
  40.         </preConditions>
  41.       </outboundRules>
  42.     </rewrite>
  43.   </system.webServer>
  44. </configuration>
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement