I am looking for a HTTP load balancing solution that will provide the following:

1) Accept HTTP connections on port X and forward them to one of multiple other hosts (and/or ports), either randomly or in a round-robin manner.

2) If the server reply contains a certain HTTP header with a certain value (i.e. 'Magic-Number: 12345'), remember it and forward all following requests containing the same header to this server.

3) At certain intervals, perform a keep-alive test by sending a specified HTTP request to all destination servers. If either server does not reply, stop forwarding to it until it comes online again.

4) (Not crucial, but nice to have) Accept HTTPS connections from clients and translate them to HTTP connections to the servers.

The solution must consist of free and/or open source software and run under Windows 200x Server.

Any suggestions?

Update: Cygwin or Portable Ubuntu (or other Colinux distribution) are also viable options, if they are able to run the appropriate *nix solutions.

  • 1
    I was with you all the way up until #4. Perhaps you should tag this with windows also. – Dan Carley Jun 10 '09 at 8:24
  • 1
    I was about to recommend Varnish it can do everything you ask for but no Windows version... – rkthkr Jun 10 '09 at 8:29
  • @dan As noted, 4) is not that important. It can always be solved with a tunnel or another proxy in front. :) – Anders Sandvig Jun 10 '09 at 8:31
  • 1
    I guess the point is not that option (4) is a problem but rather what follows option (4) namely that the software must run under Win2k. Someone tag this please Windows. – Martin M. Jun 10 '09 at 8:43
  • Sorry, I meant #5 :) – Dan Carley Jun 10 '09 at 8:53

I'm writting this out of my head/memory as I don't have anything at hand to verify whether it works correctly or not, but I hope this might be some hint for you.

So, my answer is:

Of course you can do this with Apache's mod_proxy_balancer. You should be able to acomplish this with something like that:

ProxyPassReverse / http://host1:80/
ProxyPassReverse / http://host2:80/

<Proxy balancer://cluster>
  BalancerMember http://host1:80 route=LB1
  BalancerMember http://host2:80 route=LB2
  ProxySet stickysession=MYSESSIONID

So, regarding point 1, read mod_proxy_balancer's "Request Counting Algorithm" section.

Regarding point 2: I really don't know about HTTP header parsing. Above example uses additional URL parameter MYSESSIONID to proxy traffic being part of the same connection to the same host. I guess you can also use cookies. Eitherway this should be handled by application identied as LB1 or LB2 (these are added as part of session id or cookie).

Re 3: load balancer monitors all it's members and disables them when they're unresponsive. You can also enable/disable nodes through web interface (mod_status, see "Enabling Balancer Manager Support").

As for the point 4, you can setup SSL enabled VirtualHost listening on port 443 that proxies all the trafic to balancer members port 80.


I'm using nginx for a couple of years now and very satisfied with it.

nginx (pronounced as "engine X") is a lightweight, high performance web server/reverse proxy and e-mail (IMAP/POP3) proxy, licensed under a BSD-like license.

It's good at load-balancing and reverse-proxing. Check out examples here

  • There are now Windows builds for nginx. – Jauder Ho Oct 21 '09 at 11:03

I know this is not for Windows, but I am going to answer anyways because I think that it would be really interesting in your setup to look at this aternative.

HAProxy is an HTTP Proxy (and can proxy anything else but that will be on layer 4 and below). It does just about everything you want it to do. The documentation is not very pretty, but if you actually take the time to read it, you will find it has all the info you need.

It runs on pretty much anything, so unless you're doing a lot of SSL, you won't need to buy a big, expensive machine.

  • Of course, 9 years later you can do TONS of SSL on anything. So unless you're talking about 10+Gbps of SSL traffic or higher, you're good. – MikeyB Feb 2 '18 at 17:25

Check out Pound Load Balancer which does the HTTP Header based LB:


I used in the past Apache with mod_cache on a Unix environment. It worked fine with low user load, but days with heavy load the system went down all the day.

After some tests we moved to Varnish Cache and now everything works better.

The problem is that only Unix environment is supported, a new varnish windows cygwin-based version exists, but I don't now if is suitable for production environment:


I would say this is possible with IIS 7 as well, using URL Rewrite in combination with Network Load Balancing. The basics are

  • distribute traffic over multiple hosts with NLB
  • write rewrite rules based on headers with IIS's URL Rewrite.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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