Skip to content

Instantly share code, notes, and snippets.

@ivdok
Created July 29, 2022 18:06
Show Gist options
  • Save ivdok/c9bcab7dae5a4b62aba52366f5ec43f0 to your computer and use it in GitHub Desktop.
Save ivdok/c9bcab7dae5a4b62aba52366f5ec43f0 to your computer and use it in GitHub Desktop.
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<!-- Redirect all requests to non-HTTPS site. -->
<action type="Rewrite" url="http://my.youtrack.site/{R:1}" logRewrittenUrl="true" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
<set name="HTTP_X_FORWARDED_SCHEMA" value="https" />
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
</rule>
</rules>
<allowedServerVariables>
<add name="HTTP_X_FORWARDED_HOST" />
<add name="HTTP_X_FORWARDED_SCHEMA" />
<add name="HTTP_X_FORWARDED_PROTO" />
</allowedServerVariables>
</rewrite>
<handlers>
<clear />
<!-- No other handlers required. Must clear them otherwise ASP.NET might try to intercept *.svc paths etc. -->
<add name="Rewrite" path="*" verb="*" modules="RewriteModule" resourceType="Unspecified" />
</handlers>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment