윈도우서버 iis ARR, Url Rewritter 설정 관련 질문입니다.

Taeo Kim 0 평판 포인트
2025-06-17T06:08:42.85+00:00

A, B 서버 둘 다 윈도우 서버를 사용하는 상태입니다.

저희가 보유한 Public IP가 하나 뿐이라, A 서버에서 ARR과 Url Rewritter를 사용해서 B 서버 쪽으로 Rewrite 해주는 설정을 해주려고 하는데, 만약 A서버의 iis에서 9가지의 사이트를 운영중이라고 하면

Rewrite 가 필요한 사이트를 제외한 다른 사이트들도 모두 Url Rewritter로 설정을 해주어야 하나요?

필요한 사이트만 먼저 설정을 해보았으나, 설정을 해두지 않은 인증서버쪽에 인증 요청을 할 경우 405 error를 반환하는 경우가 생겨 문의 남깁니다.

비즈니스용 Windows Server 사용자 환경 기타
댓글 0개 설명 없음
투표 {count}개

답변 1개

정렬 기준: 가장 유용함
  1. Joseph Tran 770 평판 포인트 독립 자문가
    2025-06-17T09:10:30.6033333+00:00

    Based on your scenario, you don't need to set up rewrite rules on all sites — only on the ones that should forward to Server B.

    But, ARR and URL Rewrite can also be configured at the server level (in applicationHost.config), and this is where the problem usually arises.

    I will provide for you some mains thing you should need to check here :

    - Check if ARR/URL Rewrite is Set at the Server Level

    • If you created server-wide rewrite rules (i.e., in the IIS root), they might affect all sites, even ones without explicit rules.
    • Open IIS Manager → Server Node (not individual site) → URL Rewrite → see if there are any rules there.

    -> Move rules to specific site level instead, unless they're meant to be global.

    - 405 Method Not Allowed in ARR Usually Means:

    • The proxy is trying to forward the request using a method (e.g., POST) not supported by the destination.
    • This can happen if requests are unintentionally being forwarded to Server B for sites that shouldn't be.

    -> Make sure your rules only match the intended URLs.

    - Rule Matching is Too Broad

    Sometimes, a rule like this bellow can unintentionally match other URLs and which captures all requests. If not properly scoped by hostname or path, it can hijack requests to other sites.

    <match url="(.*)" />
    

    -> Use conditions (<conditions>) in your rules to check things like HTTP_HOST or specific paths.

    And about the setup, here is some things that may help you out :

    For each site that should proxy to Server B:

    • Open that specific site's URL Rewrite.
    • Add an Inbound Rule like:
    <rule name="ReverseProxyToServerB" stopProcessing="true">
        <match url="^api/(.*)" />
        <action type="Rewrite" url="http://serverB/api/{R:1}" />
    </rule>
    
    • Use conditions to restrict by hostname or other headers if needed:
    <conditions>
        <add input="{HTTP_HOST}" pattern="^api\.yourdomain\.com$" />
    </conditions>
    

    -> For other sites (your authentication server or something else), do nothing — no rules are needed if they’re not supposed to be reverse proxied.

    But if you still see 405 Errors on Non-Proxied Sites:

    Double-check these:

    • Is ARR caching or proxying globally?
      • IIS Manager → Server Node → Application Request Routing CacheServer Proxy Settings → ensure Proxy is not applied to all requests.
    • Do other sites have web.config with unwanted rewrite rules?
    • Is there a default site with catch-all rewrite rules?
    댓글 0개 설명 없음

답변

질문 작성자가 수락한 답변이라고 답변에 표시할 수 있으며, 이를 통해 작성자의 문제를 해결한 답변을 사용자가 알 수 있도록 도와줍니다.