Skip to content

Setting up IIS as a reverse proxy

Overview

tl;dr;

This post is all about setting up IIS(8.5) in order to be used as a reverse proxy.

Use multiple different Webservers (IIS/Apache/Tomcat) and run them on the same server and port.

Installing IIS

Just install IIS by using the add roles and feature functionality of windows server 2012

Installing apache

I currently have the problem that I own a windows 2012 virtual server, and need to run IIS and Apache on it. Installation is actually super easy, just install IIS and then Apache (I took the apache binaries for windows from apachehaus )

But if you now try to start apache, the following error will show up:

(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : AH00072: make_sock: could not bind to address [::]:80

image_thumb

This happens because I'm trying to open port 80 with apache while port 80 is already used by IIS.  And the same would happen when I try to start Tomcat or any other server which tries to run on port 80.

This error can be avoided by setting the Listen Port  of apache to anything different than port 80, i.e. 8080. Problem with this solution is that any site served by apache can only be reached via port 8080 which is super uncool since a user then has to enter the port 8080 together with the domain name.

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:



    
        
            
                
                    
                    
                
            
        
    


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.

Great thing.

Trackbacks

Comments

Display comments as Linear | Threaded

Vijay on :

Does it works for tomcat?

Donato on :

I'm having problems passing authorization headers to my Apache-powered web application listening to port 8080... Is there any configuration to be set?

Prachi Sharma on :

Amazing trick, you saved my day... it worked thanks

online dissertation proposal service on :

In straightforward terms its fills in as a transitional server, which tunes in to customers inquiry. At that point solicitations to server bases of customers inquiry and returns results to customer sent by the server. This instructional exercise will help you to set up invert intermediary utilizing IIS with URL revamp and application ask for directing augmentation.

ogwhatsapp on :

Download Ogwhatsapp Ogwhatsapp is a latest mod of whatsapp in 2018. You can directly download apk from the OGwhatsapp download page OGwhatsapp

CBD öl on :

Cool you write, the information is very good and interesting, I'll give you a link to my site.

flashify on :

Thank you for bringing that experience to you. I like this post very much.

zarchiver on :

Thanks for giving me the useful information. I think I need it!

ssc kya hai on :

Thanks blogger for sharing the best article.

sham on :

GBWhatsapp apk Download Latest Version 2018. Download Latest GB Whatsapp for Use 2 Whatsapp in One Mobile.

Quitclaim Deed Form Online on :

Interactive legal form helps an unmarried person draft a Quitclaim Deed that transfers title of real property to another individual or trust.

jenny on :

Nice info it will save time. Thanks https://gbwhatsapp.pro/ogwhatsapp-apk-android-download-whatsapp-mod/

assignment writing service in Karachi on :

In all over the world, the most effective problem in the student's life is the academic or assignment writing problem and especially mostly the IT students commonly faced the problem of assignment because of the updations of the IT industry.

My assignment help on :

John Noels is working as an academic writer at Instant Assignment Help from many years. Till date, he has delivered innumerable high-quality academic documents to the students, and is adept at completing assignment writing work within deadline.

Assignment Help on :

Great Informative Post. I really appreciate your efforts about the post.

Do My Assignment on :

Nice info you have shared with us all, it will shared it as much as possible.

online assignment help on :

Global Assignment Help is No. 1 Assignment help and writing service provider across the globe. We have a large pool of qualified PhD writers who are dedicated to provide quality assignment writing service for students in all kind of subjects. Students can easily get help with assignment writing and assignment help online at very nominal price.

Superhero's on :

It is extremely exceptionally decent and stunning work to do appreciate free in the event that you are intrigue

Supply Chain Management Assignment Help on :

Assignment Prime is one of the most renowned assignment writing service providers that has been trusted by thousands of students. We cater to the academic requirements of scholars and provide them with the best every time they need help with assignments. With an experience of more than a decade, we’ve set a benchmark of being one of the leading online assignment help providers in Australia. The highly qualified assignment writers that we’ve on board work with their utmost ability to provide the best assignment help to students so that they can secure excellent marks. Once you buy assignments from us, you’ll notice a huge difference in your grades and pass your course with flying colors!

YES Bank Internet Banking on :

At present, almost every client and user want to do the most of the transactions online and for that net banking is considered one of the best methods

Andy Wilson on :

If you have any assignment requirement then you are at the right place. We will provide you with supreme quality papers at the cheapest price. 100% Plagiarism Free Content. We help students in assignments of all business subjects. We have more than 5 years of post-qualification experience in helping the students in solving their academic assignments.

Get assignment help from Professional.

Add Comment

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Markdown format allowed
Form options