Skip to content

Instantly share code, notes, and snippets.

@hoangitk
Created July 25, 2025 07:17
Show Gist options
  • Select an option

  • Save hoangitk/9dcb58bcbeacc1884c315a56fa36b6ef to your computer and use it in GitHub Desktop.

Select an option

Save hoangitk/9dcb58bcbeacc1884c315a56fa36b6ef to your computer and use it in GitHub Desktop.
[Immic IIS hosting] #immich #hosting #tips
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpRuntime requestPathInvalidCharacters="" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<clear />
</hiddenSegments>
<denyUrlSequences>
<clear />
</denyUrlSequences>
<fileExtensions allowUnlisted="true">
<clear />
</fileExtensions>
</requestFiltering>
</security>
<rewrite>
<rules useOriginalURLEncoding="false">
<rule name="Immich Reverse Proxy" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost:2283/{R:1}" />
<serverVariables>
<set name="HTTP_HOST" value="{HTTP_HOST}" />
<set name="HTTP_X_REAL_IP" value="{REMOTE_ADDR}" />
<set name="HTTP_X_FORWARDED_FOR" value="{REMOTE_ADDR}" />
<set name="HTTP_X_FORWARDED_PROTO" value="{HTTPS}" />
<set name="HTTP_UPGRADE" value="{HTTP_UPGRADE}" />
<set name="HTTP_CONNECTION" value="{HTTP_CONNECTION}" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="NeedsRestoringAcceptEncoding">
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<urlCompression doDynamicCompression="true" />
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*"
modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule"
resourceType="Either" requireAccess="Read" />
</handlers>
<!-- Map all extensions to the same MIME type, so all files can be
downloaded. -->
<staticContent>
<clear />
<mimeMap fileExtension="*" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment