Iis – WordPress wp-admin redirect loop behind IIS ARR Reverse Proxy

apache-2.2arriisreverse-proxyWordpress

I've got a bit of a unique and interesting setup going on from what I can tell, with an interesting issue. I have a Windows Server 2012 box as my main web server hosting website.com. At http://website.com/sites/ I have a reverse proxy setup with ARR to point everything back to a WordPress WPMU install on a Debian box running Apache. Here's the rewrite rule configuration:

enter image description here

Now, everything works properly but the one thing messing up is that if I go to any wp-admin/ page through the reverse proxy, I get a redirect loop:

enter image description here

For the sake of being accurate with what I'm describing, here is my .htaccess file and my wp-config.php file (obvious stuff omitted).

What I find interesting is that if I change my local hosts file to point my domain to the Debian IP address and bypass the IIS ARR, then wp-admin/ works just fine, no issues. It just seems that my issue is somewhere with the translation between IIS and Apache? I'm at a loss for what to look at and debug this any further.

Any help would be super appreciated!

Best Answer

Possibly it happens because Host header is modified by ARR.

GET http://10.48.100.27/ HTTP/1.1
Host: 10.48.100.27

HTTP/1.1 301 Moved Permanently
Location: http://example.com/

Use preserveHostHeader setting to keep the header unchanged.

https://stackoverflow.com/a/7180527/991267