# Newbie - basic requirement

**URL:** <https://discourse.haproxy.org/t/newbie-basic-requirement/8879>\
**Category:** Help!\
**Created:** [July 27, 2023, 8:14am UTC](https://discourse.haproxy.org/t/newbie-basic-requirement/8879 "2023-07-27T08:14:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Systellence](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Systellence](https://discourse.haproxy.org/u/Systellence)\
**Post date:** [July 27, 2023, 8:14am UTC](https://discourse.haproxy.org/t/newbie-basic-requirement/8879/1 "2023-07-27T08:14:25Z")

</div>

Hello!

I am a complete newbie in Load balancing and because many suggested HAProxy I have started to do some extensive reading on it and tried many options.

To be honest, I am completely lost and really need help.

We have a web system hosted on a Windows IIS Server which works perfectly. We have several copies of this system and for each copy we have an address like [ww1.system.com](http://ww1.system.com), [ww2.system.com](http://ww2.system.com) etc…All working well.

Then we also have a Linux server where we installed HAProxy. We point a domain [www.system.com](http://www.system.com) to this server.

So all we want is for when a user enters [www.system.com](http://www.system.com) that HAProxy gets the request on this server, and according to roundrobin or leastconnections choose a ww1 to ww10 alternative and reroute it. It should not handle responses as it is merely a redirect.

Preferably IIS should not even be aware of it. The user can see ww1 in the address bar - that doesn’t matter.

I have tried MANY options but cannot get it to work.

Help will really be appreciated.

Kind regards,

Jaco

---

<div class="post-metadata">

**Author:** ![Markus](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Markus](https://discourse.haproxy.org/u/Markus)\
**Post date:** [July 28, 2023, 9:48am UTC](https://discourse.haproxy.org/t/newbie-basic-requirement/8879/2 "2023-07-28T09:48:49Z")

</div>

you should start with one of the simple configs. haproxy can do a lot more than just loadbalancing. you can setup ACL, do redirects based on url path etc.

but with your simple requirements something like

> **[HAProxy Configuration Basics: Load Balance Your Servers](https://www.haproxy.com/blog/haproxy-configuration-basics-load-balance-your-servers)**
>
> If you’re new to using the HAProxy load balancer, you’re at the right place. In this blog post, you’ll learn how to configure HAProxy for basic load balancing.

IP 1.2.3.4 is the ip address of your haproxy server.  
in this sample we do http balancing (on port 80). you also can do SSL loadbalancing but this will need some more (but not really complicated) config  
you can also have “sticky” servers based on client-ip or cookie/session var if it is possible. so that one client request will hit every time the same backend server to maintain the user-session

```auto
defaults
  mode http
  timeout client 10s
  timeout connect 5s
  timeout server 10s 
  timeout http-request 10s

frontend myfrontend
  bind 1.2.3.4:80
  default_backend myservers

backend myservers
   server server1 ww1.system.com:80
   server server2 ww2.system.com:80
   server server3 ww3.system.com:80

```

this is the most simply way of load balancing. you can do a server weight for each backend. you can enable stat page for haproxy even with maintaining options where you can disable one of the backend servers

user will always see [www.system.com](http://www.system.com). no “redirect” or “url-change” to [wwx.system.com](http://wwx.system.com).  
IIS will see ip-address of haproxy as “client address”. there is somehting like http\_forwared\_for which you can set so that you will see the real clients ip address

---

<div class="post-metadata">

**Author:** ![Systellence](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Systellence](https://discourse.haproxy.org/u/Systellence)\
**Post date:** [July 28, 2023, 10:26am UTC](https://discourse.haproxy.org/t/newbie-basic-requirement/8879/3 "2023-07-28T10:26:31Z")

</div>

Thank you so much! In the meantime I got it to work!
