Reverse Proxy IIS Server2012


Setup IIS

 

In order to use IIS as a reverse proxy, the rewrite module must be installed. This can be done by downloading it from the microsoft website

image_thumb6

To get rewrite(Not only redirect) working, the application request routing must be installed as well from the microsoft website

Now the Application Request Routing must be configured in IIS manager. It's as simple as checking the Enable proxy checkbox.

image_thumb8

image_thumb10

Now a new website must be added in IIS pointing to an empty directory. In order for IIS to act properly as a proxy, this website must be bound to a host name. (For this demo and since I don't have a hostname, I just added a entry into the host file of the computer)

image_thumb4

When now connecting to this site, noting must be shown since there is no content in the configured folder.

Next step is to setup the rewrite rule.

 

Setup rewrite rule in IIS

 

Add a new Blank rule via URL rewrite

image_thumb15

image_thumb14

The rule must look like the following sample.

This is the corresponding web.config to the screenshot below: 

<!--?xml version="1.0" encoding="UTF-8"?-->
<configuration>
    <system.webserver>
        <rewrite>
            <rules>
                <rule name="test" patternsyntax="Wildcard" stopprocessing="true">
                    <match url="*">
                    <action url="http://proxytest.com:8080/{R:0}" type="Rewrite">
                </action></match></rule>
            </rules>
        </rewrite>
    </system.webserver>
</configuration>

image_thumb17

 

Done

Now it's done. Requests sent to proxytest.com:80 will be rewritten from IIS to the address from rewrite URL.

With this configuration, it's possible to run IIS, Apache, Tomcat and many other webserver at the same time on the same server under the same port.

 

Note - If after doing all this, the rewrite doesn't work, Navigate to Programs and Features and select Repair on IIS URL Rewrite, it should all start working after that.

Last update:
20-01-2016 16:58
Author:
Karl Hudgell
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Latest FAQs RSS

  1. Freeing disk space on your Linux server (20-04-2019 12:48)
  2. Dockerized Download VM (30-01-2019 20:26)
  3. Jmeter + Performance Plugin + Jenkins Pipeline (16-02-2018 12:49)
  4. MySQL DB Backup Script (04-09-2017 10:16)
  5. Replace Cabin Filter (20-02-2017 13:45)