Add IIS config for easier windows setup

pull/66/head
Matt Kilgore 2020-07-27 18:53:53 -04:00 committed by GitHub
parent 0ef4318913
commit 6cf27444b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 51 additions and 0 deletions

51
public/web.config Normal file
View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Disallow .git" stopProcessing="true">
<match url="/\.git" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Disallow auth.json" stopProcessing="true">
<match url="^auth\.json$" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Disallow composer.lock and json" stopProcessing="true">
<match url="^composer\.(lock|json)$" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Disallow config.php" stopProcessing="true">
<match url="^config.php$" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Imported Rule" stopProcessing="true">
<match url="^flarum$" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Disallow storage directory" stopProcessing="true">
<match url="^storage/(.*)?$" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Disallow vendor directory" stopProcessing="true">
<match url="^vendor/(.*)?$" ignoreCase="false" />
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Handle index.php re-write" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>