IIS Reverse Proxy Module 500 error when going to PHP backend

/ May 13th, 2013/ Posted in IIS, Server / 1 Comment »

When setting up IIS reverse Proxy to connect back to a linux PHP application the site would not load and IIS would throw a 500 error. When browsing to the PHP site from the IIS server manually no errors and connectivity was working fine.

I missed an option in the web.config file for the PHP pattern “pattern=”^text/php”” :

<?xml version="1.0" encoding="UTF-8"?>
          <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
            <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://10.0.xxx.81/(.*)" />
            <action type="Rewrite" value="http{R:1}://www.xxxx.com/{R:2}" />
            <preCondition name="ResponseIsHtml1">
              <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
	      <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/php" />
                <clear />
                <rule name="index" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" />
                    <action type="Redirect" url="http://www.xxxx.com/xx/slovenia/index.php" />
                <rule name="ReverseProxyInboundRule1" patternSyntax="ECMAScript" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                    <action type="Rewrite" url="http://10.0.xxx.81/bd/slovenia/{R:0}" />

One Comment

  1. Ben
    2013/06/11 at 07:25:36


Leave a Reply

Name required

Please Submit Answer *