1

The scenario: A web server running a single site under two different addresses:

  • www.mysite.com (regular site)
  • ws1.mysite.com (web services)

Both are accessible via HTTPS, and both are running on the same application (whether it's a web service call or a regular www call is handled programmatically).

I have a web page on that www site which calls a web service on the ws1 site via Javascript. This is technically a CORS call. However, for backward compatibility, I want to make the calls non-CORS. The best way to do this would be to make a URL Rewrite rule to fork a custom address (say www.mysite.com/ws1/) to the web services place (ws1.mysite.com) so the browsers aren't aware this is CORS (because, in the end, it's not "Cross-Origin", really).

So, I've setup the following rules on the site:

<rewrite>
    <rules>
        <remove name="WS1-Inbound" />
        <rule name="WS1-Inbound" enabled="false">
            <match url="^ws1/(.*)" />
            <conditions />
            <serverVariables />
            <action type="Rewrite" url="https://ws1-mysite.com/{R:1}" logRewrittenUrl="true" />
        </rule>
    </rules>
    <outboundRules>
        <remove name="WS1-Outbound" />
        <rule name="WS1-Outbound" enabled="false">
            <match filterByTags="None" pattern="^https://ws1-mysite.com/(.*)" />
            <conditions />
            <action type="Rewrite" value="ws1/{R:1}" />
        </rule>
    </outboundRules>
</rewrite>

This returns a 404.4. Ah, so I turn on ARR, and now I get a 502.3.

The inbound rule is applied successfully, it never gets to the outbound rule.

Do I:

  1. Need to turn on ARR at all in this situation?
  2. Need to handle SSL in some special way? I just need it to pass through.
MPelletier
  • 51
  • 11

1 Answers1

0

In this case, an HTTP Redirect instruction configured in IIS was interfering.

EDIT:

At the web site node in IIS Manager, I had an HTTP Redirect configured. The "Redirect requests to this destination" checkbox was checked, with "https://www.thisismysite.com" (minus "this is". Thanks formatting...) as the address. Below, under "Redirect behavior", "Redirect all requests to exact destination (instead of relative to destination)." Status code selected was "Found (302)".

I unchecked "Redirect requests to this destination". I'm still trying to figure out how that actually fixed things.

MPelletier
  • 51
  • 11