I have a problem with Wordpress and running it behind a reverse proxy. I have localized the problem and it was the solution to the question posed here: Modifying headers with IIS7 Application Request Routing
Before I applied the command in the accepted solution above, I was unable to visit any links on the website and got a too many redirects error. Turning on the option to preserve the original host header fixed those issues. But immediately after I was no longer able to edit individual pages, it would not load and return a ERR_CONNECTION_RESET error.
Since this happened right after I applied the command above I tested by turning it off again and now it works again. And predictably the other errors returned as well. So I am at an impasse here. Anyone know why the connection suddenly resets with this option turned on?
The URL that resets looks like this: http://www.siteurl.com/wp-admin/post.php?post=19&action=edit
This is the web.config for the reverse proxy site:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.111.15:8080/{R:1}" />
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="[HTTP_ACCEPT_ENCODING]" />
<set name="HTTP_ACCEPT_ENCODING" value="eee" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml2">
<match filterByTags="A, Form, Img" pattern="^http(s)?://192.168.111.15:8080/(.*)" />
<action type="Rewrite" value="http{R:1}://www.siteurl.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml2">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
<add input="{HTTP_HOST}" pattern="siteurl.com" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>