Hi,
I have a default site on my server with IIS 8 running. The default site is bound to port :80 and can be accessed from outside.
I also have two other subsites that has port :8081 and :8082
I set up the sites so I can access them from externally by adding /sitename after thehttp://servername
THe default site has basic html and hyperlinks to the other two sites
The first site (SiteOne) has some basic HTML in the landing page and it is also accessible form outside if I brows to it using the IP address like this.http://xxx.xxx.xxx.xxx/testsite. or using the hyperlink in the default page.
The second site (SiteTwo) has reverse proxy set up so it connects to an external server with its own IP address. If I test the site on the server, it works and connects to the external server. However, when I click the hyperlink in the default site or enter
the address like this - http://xxx.xxx.xxx.xxx/SiteTwo and try and connect to the external site, it does not connect. It seems that it only returns the page title which I can see n the internet explorer tab.
I tested the external server reverse proxy by changing the port of SiteTwo to port 80 and stopping the default site. When I now brows to the server from an external browser, the reverse proxy works fine but cannot seem to get it working with a hyperlink
on the default site.
How can I open the second site with the reverse proxy working. See config files below.
Thanks
The config file in the default website looks like this
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="reverse proxy to Site One" stopProcessing="true">
<match url="^SiteOne/(.*)" />
<action type="Rewrite" url="http://localhost:8081/{R:1}" />
</rule>
<rule name="reverse proxy to test" stopProcessing="true">
<match url="^SiteTwo/(.*)" />
<action type="Rewrite" url="http://localhost:8082/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
The configuration for the reverse proxy site looks like this:
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://192.168.10.103/(.*)" />
<action type="Rewrite" value="http{R:1}://server IP address/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.10.103/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>