* IIS에서 Visual SVN Server로 Reverse Proxy 설정시 특정 HTTP 동사(COPY, MOVE)에서 HTTP 502 Gateway 관련 내용 발생
* HTTP_DESTINATION 서버 변수 등록 및 사용 관련 내용 참조
* 샘플용 web.config (인바운드만 참조)
* 외부 접속 주소 (샘플) : svn.test.com
* 내부 Visual SVN Server 접속 주소 : 127.0.0.1:8080
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="http://127.0.0.1:8080/(.*)" />
<action type="Rewrite" value="https://svn.test.com/{R:1}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="To https" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
</rule>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_DESTINATION}" pattern="https://(.*)" />
</conditions>
<serverVariables>
<set name="HTTP_DESTINATION" value="http://{C:1}" />
</serverVariables>
<action type="Rewrite" url="http://127.0.0.1:8080/{R:1}" />
</rule>
<rule name="ProxyRest" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" negate="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="http://127.0.0.1:8080/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
<urlCompression doStaticCompression="false" doDynamicCompression="false" />
<security>
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="2147483648" maxUrl="2147483648" maxQueryString="2147483648" />
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
<clear />
</fileExtensions>
<verbs allowUnlisted="true" applyToWebDAV="true">
<clear />
</verbs>
<hiddenSegments applyToWebDAV="true">
<clear />
</hiddenSegments>
</requestFiltering>
</security>
</system.webServer>
</configuration>
'Server > Windows Server' 카테고리의 다른 글
PowerShell - Mail 발송 (0) | 2024.02.21 |
---|---|
Windows 배포 서비스 구성 오류 (0) | 2023.11.17 |
IIS - disable Application Request Routing Cache (0) | 2023.02.13 |
Windows Server 2008 R2 SP1 에서 .Net Framework 4.0 이상 사용시 WCF 등의 오류 처리 (0) | 2022.12.21 |
Microsoft Exchange Server Online (Microsoft 365) oAuth용 Azure AD 설정 (0) | 2022.10.19 |