2009-09-27 5 views
8

IIS7과 응용 프로그램 요청 라우팅 확장을 사용하여 Apache에서 실행되는 Subversion의 역방향 프록시 역할을합니다.Subversion의 역방향 프록시로 사용되는 IIS7 및 ARR

프록시가 제대로 작동하고 서버를 탐색 할 수 있으며 "체크 아웃"도 수행 할 수 있습니다. 그러나 ASP.NET에서 일반적으로 금지하는 파일 (예 : .cs, .csproj)을 탐색 할 수 없습니다. ASP.NET에서 걱정하지 않을 파일 (예 : .txt)은 괜찮습니다.

전역 web.config를 편집하여 이러한 파일에 대한 금지 된 처리기 매핑을 제거하려고 시도했지만 차이가없는 것으로 보입니다. 모든 파일 확장명을 렌더링하는 동안 IIS7에서 URL 재 작성 모듈이 작동하도록 허용하는 방법이 있습니까?

답변

13

IIS7은 파일 확장자를 제한하는 보안 섹션이있는 applicationHost.config 파일이 있습니다 :

<requestFiltering> 
    <fileExtensions allowUnlisted="true" applyToWebDAV="true"> 
    <add fileExtension=".cs" allowed="false" /> 
    <add fileExtension=".csproj" allowed="false" /> 
    <add fileExtension=".vb" allowed="false" /> 
    <add fileExtension=".vbproj" allowed="false" /> 
    .... 
    </fileExtensions> 

더 많은 정보 : http://learn.iis.net/page.aspx/143/how-to-use-request-filtering/

내가 내 사이트의 web.config 유사한 섹션을 추가 모든 확장을 제거하려면 <clear /> 노드를 사용하십시오. 이제 .cs, .csproj 파일 및 기타 서비스를 제공 할 수 있지만 아직 .config 파일을 제공 할 수 없습니다.

편집 : hiddenSection 노드를 제거하면 web.config 파일에도이 문제가 해결되었습니다.

<system.webServer> 
    <security> 
    <requestFiltering> 
     <fileExtensions allowUnlisted="true" applyToWebDAV="true"> 
     <clear /> 
     </fileExtensions> 
     <verbs allowUnlisted="true" applyToWebDAV="true" /> 
     <hiddenSegments applyToWebDAV="true"> 
     <clear /> 
     </hiddenSegments> 
    </requestFiltering> 
    </security> 
</system.webServer> 
+0

그래,이 날 위해 일했습니다 여기 내 로컬 web.config 파일입니다. +1 –

+0

답변입니다. 고맙습니다! – Alexandr

3

내가 내 Web.config를 그렇게처럼 보이는 작업을 가지고 :

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="ReverseProxyInboundRule1" stopProcessing="true"> 
        <match url="(.*)" /> 
        <conditions> 
         <add input="{CACHE_URL}" pattern="^(https?)://" /> 
        </conditions> 
        <action type="Rewrite" url="{C:1}://localhost:8080/{R:1}" /> 
       </rule> 
      </rules> 
      <outboundRules> 
       <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1"> 
        <match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:8080/(.*)" /> 
        <action type="Rewrite" value="http{R:1}://svn.mysite.com/{R:2}" /> 
       </rule> 
       <preConditions> 
        <preCondition name="ResponseIsHtml1"> 
         <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 
         <add input="{RESPONSE_CONTENT_ENCODING}" pattern="[^(gzip)]" /> 
        </preCondition> 
       </preConditions> 
      </outboundRules> 
     </rewrite> 
     <security> 
     <requestFiltering> 
      <fileExtensions allowUnlisted="true" applyToWebDAV="true"> 
      <clear /> 
      </fileExtensions> 
      <verbs allowUnlisted="true" applyToWebDAV="true" /> 
      <hiddenSegments applyToWebDAV="true"> 
      <clear /> 
      </hiddenSegments> 
     </requestFiltering> 
     </security> 
    </system.webServer> 
</configuration> 
관련 문제