Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have several web applications running on my developer machine. They mimic our production web applications which are hosted on sub-domain. For example, consider: - is mimicked by - is mimicked by    
and so on...

How can I make it so that, on my Windows 7 machine, HTTP calls to "" (note the lack of port number) are redirected to etc? Note that this needs to apply both to client-side calls (in the browser) and server-side calls (from IIS to Python development server and vice versa).

Do I need a proxy to run locally to achieve this? Can you recommend such a tool?

share|improve this question
Just to be clear, what server is your dev machine running? IIS? – Nick Downton Jun 24 '11 at 8:06
I'm running IIS alongside Python development server. There are several server processes of different kinds. – urig Jun 24 '11 at 16:31

3 Answers 3

up vote 6 down vote accepted

Actually the solution to your problem is much simpler than port translation.

Since the entire 127.x.x.x IP block is routed to the local host you can use any IP you want in this block and bind it to each web site.

For examlpe, edit your hosts file to bind:

Configure each site to bind to its IP address.

Note that since you want to use other servers beside IIS, and IIS tends to hoard all the available IPs for port 80 you need to disable socket pooling for this to work perfectly:

share|improve this answer
+1, very elegant – orip Jun 26 '11 at 9:57
Works like a charm. Thank you. :) – urig Jun 28 '11 at 14:11

You should configure your web sites to answer to different host headers instead of different ports, and then use your hosts file to map all of these names to; this way, you will be able to simply type "" or "" in your web browser, and the correct site will be used.

share|improve this answer
My web applications run in separate processes, doesn't that mean only one of them can listen on port 80 while the others can't? – urig Jun 24 '11 at 15:04
No, web servers can serve you different sites depending on the host name the browser asks for. This is part of the HTTP protocol and is called "host headers". But of course, they have to use the same web server, if you want f.e. to run Apache and IIS at the same time, they can't use the same port. – Massimo Jun 24 '11 at 17:42
That's my situation. I'm running several different processes (IIS, Apache, Python dev server) so your solution doesn't apply for me :| – urig Jun 26 '11 at 8:29

Apache with mod_proxy does what you want. Example:

    ProxyRequests On
    ProxyPreserveHost On
    ProxyPass /

Define a VirtualHost definition like this for every subdomain you need.

share|improve this answer
Will this technique work even if my web applications are not hosted on Apache? Some run under IIS while others run in "Python development server" - can Apache redirect the requests to these web servers? – urig Jun 24 '11 at 15:05
Apache only act's an http proxy here, is forwarding http requests. so as long your server is an http server, it should work. – sborsky Jun 25 '11 at 9:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.