-
Notifications
You must be signed in to change notification settings - Fork 22
/
iis.config
33 lines (31 loc) · 1.21 KB
/
iis.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<system.webServer>
<rewrite>
<rules>
<rule name="webp">
<match url="(.+)\.(jpe?g|png)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_ACCEPT}" pattern="image/webp" ignoreCase="false" />
<add input="{DOCUMENT_ROOT}/{R:1}.webp" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="{R:1}.webp" logRewrittenUrl="true" />
<serverVariables>
<set name="ACCEPTS_WEBP" value="true" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="Set Vary header" preCondition="IsWebp">
<match serverVariable="RESPONSE_Vary" pattern=".*" />
<action type="Rewrite" value="Accept"/>
</rule>
<preConditions>
<preCondition name="IsWebp">
<add input="{ACCEPTS_WEBP}" pattern="true" ignoreCase="false" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".webp" mimeType="image/webp" />
</staticContent>
</system.webServer>