Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS reverse proxy with rewrites can't handle a redirect from the server we proxy to

We own server A, and on some occasions we rewrite requests to our partner on server B.

In some cases server B will respond with a redirect to a completely different website, which is what is expected, let's say server C. However, when that redirect form server B comes back to server A, server A interprets it as a redirect to a location on iteself (A) and not as a redirect to other website - server C.

How do I take note of the redirect to the external website and actually go there, rather than assuming that redirect is on my server (and 404ing)? We're running IIS 7 with the rewrite module.

Any help much appreciated.

like image 680
IISrewriteproblems Avatar asked Nov 22 '10 09:11

IISrewriteproblems


People also ask

How does IIS reverse proxy work?

The basic setup for the reverse proxy is now complete, with IIS able to capture incoming traffic and forward it to the backend server, and inspect responses from the backend server and rewrite URL links inside the responses to match the host headers that IIS uses to publish the site.

Can IIS act as a reverse proxy?

By default, IIS does not come with reverse proxy routing capability. To enable it, we need to manually install certain extensions first. Click the links below to download & install the extensions. After installing the extensions, you should see an option URL Rewrite added to the IIS dashboard under Default Web Site .


1 Answers

Go to the ARR proxy settings (they're hidden under IIS -> Application Request Routing Cache -> Server Proxy Settings) and uncheck the "Reverse rewrite host in response headers" checkbox. That should be enough.

like image 89
LukasRos Avatar answered Sep 20 '22 06:09

LukasRos