Home » setup IIS reverse proxy

setup IIS reverse proxy

by mn.sobieh

A proxy server acts as an intermediary for requests from clients seeking resources from servers that provide those resources, In other words, The proxy controls and filters the data that go through it. Hence, organizations use it to filter and control Internet access, or to protect their servers. This article explains how to setup IIS reverse proxy using Application Request Routing ARR addons, So you can protect your servers.

This article is part of a series, how to manage, and troubleshoot the Microsoft IIS server.

  1. Install IIS on Windows Server. 
  2. Configure a reverse proxy.
  3. Setup IIS SSL certificate. 
  4. troubleshoot IIS reverse proxy error 500.25.
  5. troubleshoot IIS reverse proxy ERR_CONNECTION_RESET.

Why would I setup a reverse proxy?

Proxy servers provide varying levels of functionality, for example, security to achieve load balancing and high availability. For example, a website may have several web servers behind the reverse proxy for high availability. Above all, It depends on your use-case, needs, or company’s policy.

How to configure a reverse proxy server on IIS server?

Easy two steps to enable reverse proxy in IIS.

Install IIS extension.

  • URL rewrite extension: Download the extension from here. Or google it.
  • Application Request Routing (ARR) extension from here. Or google it.

Create an inbound rule

Allow redirection of any request coming to proxy to your Internal server.

Proxy Inbound

Create outbound rule (Optional)

Allow you to control outbound transactions based on conditions redirection of any transaction coming from the server to the client to be masked with a specific URL.

Proxy outbound

Full example,  step by step Setup IIS reverse proxy.

In this example we prepare two servers, the internal web server uses Ubuntu and the second server will act as a proxy server. As shown in the following table

  Reverse Proxy WebServer
Operating System Windows Linux
IP Address 192.168.160 192.168.157.180
port 80 80
protocol HTTP HTTP
Server Name prxy Srv

Server names should be added to the client hosts file

Configure Internal server Installing Apache webserver

Easy steps just install apache webserver using the following command

 sudo apt-get install apache2 -y

Then , check if the apache installed the default index.html page. by executing the following command.

ls /var/www/html/index.html

Also, test your installation by opening your browser. then, type Ubuntu server IP to test if the webserver is runing. You should see a page like that

ubuntu-index

Configure IIS Proxy Server

Firstly, Open the IIS Manager. then, on the left side Navigate under “server name”, right-click on “Sites”, then chose Add website. After that, In the new window, enter the website name, location, and Listening Host-name.Create Website

Than, On the right side click on URL Rewrite Icon.

Choose Reverse Proxy then click OK. It will ask if you want to enable Proxy functionality, so click OK.

Add Rule

After that, when the Add Reverse Proxy window appears in the upper section titled ” inbound Rules” enter the Internal server hostname or IP  of the internal server where HTTP requests will be forwarded to.

configure Reverse Proxy

Finally, do not check the outbound rules as we will configure it separately, Click OK.

Conclusion 

To summarize, with these steps you configured IIS to work as a reverse proxy server. you can test your efforts by typing the IP/URL in the browser.

 

 

You may also like

Leave a Comment