1

https://www.iis.net/learn/ext...


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="api" stopProcessing="true">
          <match url="api/.*" />
          <action type="Rewrite" url="http://xxxx/{R:0}" logRewrittenUrl="true" />
        </rule>
        <rule name="fixhtml5mode" stopProcessing="true">
          <match url="^((?!blog)(?!api).)*$" />
          <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>
    <staticContent>
      <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
    </staticContent>
  </system.webServer>
</configuration>

static folder

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
    </staticContent>
  </system.webServer>
</configuration>

index.html no-cache

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <location path="index.html">
    <system.webServer>
      <httpProtocol>
        <customHeaders>
          <add name="Cache-Control" value="no-cache" />
        </customHeaders>
      </httpProtocol>
    </system.webServer>
  </location>

</configuration>

Chobits
7.4k 声望171 粉丝

保卫骡博 Chobits#3780