I’m attempting to set up a reverse proxy through IIS to serve a third party JavaScript file on a first party hostname. I’ve installed the ARR module into IIS and created a URL rewrite rule but for some reason it isn’t taking effect. I’ve also gone into the ARR module in IIS and ensured that ‘Enable Proxy’ is set in the ‘server proxy settings’ section.
Essentially I need to respond to requests on my domain
http://my.local.com/iojs/dyn_wdp.js
yet actually serve the file from:
https://third.party.com/latest/dyn_wdp.js
My URL rewrite rule is as follows:
<rule name="reverseproxy" stopProcessing="false">
<match url="^(.*)iojs/(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="https://third.party.com/{R:2}" appendQueryString="false" />
</rule>
However, when I hit
http://my.local.com/iojs/dyn_wdp.js
in my browser, I’m still getting a controller not found exception in asp.net MVC.
Update: I've noticed that if I change the action type to redirect (301) it works, but this redirects on the client which isn't what I want. Its a rewrite that I need to do such that the JS appears to be served from my server.
Has anyone done this kind of things before, and if so, what step am I missing?
https://third.party.com/...
URL to your IIS server which is effectively giving a 404 as it's not responsible for serving that domain. – DavidGdyn_wdp.js
? – Venky