简体   繁体   中英

IIS Rewrite / Application Request Routing (ARR) Half-working

I have several rules in my rewrite, including ARR that have been working for over a year, now it's almost like the top rules in the web.config file are no longer being called in the correct order.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="AuthRoute" stopProcessing="true">
          <match url="(auth$|auth/(.*))" />
          <action type="Rewrite" url="http://localhost:8083/auth/{R:2}" />
        </rule>
        ...
        <rule name="Non-File Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="/index.html" />
        </rule>
      </rules>
    </rewrite>

  </system.webServer>
</configuration>

As you can see, I have a separate route for /auth that reverse-proxies to a different application designed for everything in /auth ... In this case, there are several files foo.HASH.css and foo.HASH.js that are actually there, the backend application is serving them, but the front end is getting the parent application (via IIS) of the /index.html .

Some files are being reverse proxied correctly, others simply are not. It's weird, I'm not sure if it's a windows/iis update that started this or what.

Turns out the content for the app being reverse proxied wasn't being published with the path prefix. Since browsers aren't showing the full path in the list, the aren't too load from root was missed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM