92 lines
5.0 KiB
XML
92 lines
5.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
This configuration file is required if iisnode is used to run node processes behind
|
|
IIS or IIS Express. For more information, visit:
|
|
|
|
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
|
|
-->
|
|
<configuration>
|
|
<system.webServer>
|
|
<staticContent>
|
|
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
|
|
<mimeMap fileExtension=".m4v" mimeType="video/m4v" />
|
|
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
|
|
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
|
|
<mimeMap fileExtension=".webm" mimeType="video/webm" />
|
|
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
|
|
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />
|
|
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
|
|
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
|
|
<remove fileExtension=".eot" />
|
|
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
|
|
<mimeMap fileExtension=".otf" mimeType="font/otf" />
|
|
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
|
|
<mimeMap fileExtension=".woff2" mimeType="font/x-woff" />
|
|
<mimeMap fileExtension=".json" mimeType="application/json" />
|
|
<clientCache setEtag="true" cacheControlMode="UseMaxAge" cacheControlMaxAge="01:00:00" cacheControlCustom="public" />
|
|
</staticContent>
|
|
<rewrite>
|
|
<rules>
|
|
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
|
|
<match url="(.*)" />
|
|
<conditions>
|
|
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="https" negate="true" />
|
|
<add input="{HTTP_HOST}" pattern="tparnellblognew.azurewebsites.net" negate="true" />
|
|
<add input="{HTTP_HOST}" pattern="localhost" negate="true" />
|
|
<add input="{REMOTE_HOST}" pattern="localhost" negate="true" />
|
|
</conditions>
|
|
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
|
|
</rule>
|
|
<!--<rule name="HTTP to HTTPS redirect" stopProcessing="true"><match url="(.*)" /><conditions><add input="{HTTPS}" pattern="off" ignoreCase="true" /></conditions><action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /></rule>-->
|
|
<rule name="Domain redirect" stopProcessing="true">
|
|
<match url="(.*)" />
|
|
<conditions>
|
|
<add input="{HTTP_HOST}" pattern="(blog)\.(tommyparnell|tparnell)" />
|
|
</conditions>
|
|
<action type="Redirect" url="https://blog.terribledev.io/{R:0}" />
|
|
</rule>
|
|
<rule name="SpecificRewrite" stopProcessing="true">
|
|
<match url="^rss$" />
|
|
<action type="Rewrite" url="public/rss.xml" />
|
|
</rule>
|
|
<rule name="Add trailing slash" stopProcessing="true">
|
|
<match url="^(.*[^/])$" />
|
|
<conditions>
|
|
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
|
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
|
<!--<add input="public{REQUEST_URI}" matchType="IsDirectory" negate="true" /><add input="public{REQUEST_URI}" matchType="IsFile" negate="true" />-->
|
|
<add input="{REQUEST_FILENAME}" pattern="(.*?)\.[a-zA-z1-9]+$" negate="true" />
|
|
<add input="{HTTP_HOST}" pattern="^.+$" />
|
|
</conditions>
|
|
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:0}/" />
|
|
</rule>
|
|
<rule name="redirectTag" stopProcessing="true">
|
|
<match url="^(tags/)(.*)" />
|
|
<conditions>
|
|
<add input="{HTTP_HOST}" pattern="^.+$" />
|
|
</conditions>
|
|
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/tag/{R:2}" />
|
|
</rule>
|
|
<rule name="StaticContent">
|
|
<action type="Rewrite" url="public{REQUEST_URI}"/>
|
|
</rule>
|
|
</rules>
|
|
</rewrite>
|
|
<httpErrors>
|
|
<remove statusCode="404" />
|
|
<error statusCode="404" responseMode="Redirect" path="/404/" />
|
|
<remove statusCode="500" />
|
|
<error statusCode="500" responseMode="File" path="public/500/index.html" />
|
|
</httpErrors>
|
|
<httpProtocol>
|
|
<customHeaders>
|
|
<remove name="X-Powered-By" />
|
|
<add name="X-Powered-By" value="Fortran" />
|
|
</customHeaders>
|
|
</httpProtocol>
|
|
</system.webServer>
|
|
<system.web>
|
|
<customErrors mode="RemoteOnly">
|
|
</customErrors>
|
|
</system.web>
|
|
</configuration> |