IIS reverse proxy to phpBB configuration not rewriting outbound URLs

Go To StackoverFlow.com

0

I have a phpBB server running on one box. I want to expose it via our main server that is running IIS7. The inbound rewrites appear to be working perfectly. But I cannot seem to get the outbound to do anything all.

Here is my config:

<rewrite>
  <rules>
    <rule name="forums - inbound reverse proxy">
      <match url="^gamer/forums/(.*)" />
      <action type="Rewrite" url="http://phpbbsrv/{R:1}" />
    </rule>
  </rules>
  <outboundRules>
    <rule name="forums - outbound HTTP rewrites">
      <match pattern="(.*)://phpbbsrv/(.*)" />
      <action type="Rewrite" value="{R:1}://{HTTP_HOST}/gamer/forums/{R:2}" />
    </rule>
  </outboundRules>
</rewrite>

When logging into phpBB3, the "You have been successfully logged in" page has a META refresh tag and a normal A HREF link that both contain http://phpbbsrv/. They aren't being rewritten. I've turned on Failed Request Tracing, but it apparently doesn't log much with outbound rules.

Thoughts on how to proceed?

2012-04-04 07:50
by mobiGeek
BTW: I have been all over the standard IIS/reverse-proxy blogs like http://learn.iis.net/page.aspx/659/reverse-proxy-with-url-rewrite-v2-and-application-request-routing - mobiGeek 2012-04-04 19:08


0

I might need to get some sleep. Apparently I meant to use SERVER_NAME, not HTTP_HOST, in the outbound rule. It is doing exactly what I told it to do...as computers tend to do.

Sorry for the noise.

2012-04-05 04:17
by mobiGeek
Ads