Nginx – Reasons to Use for Load Balancing Exchange 2019

exchangehaproxyload balancingnginx

I've prototyped load balancing my Exchange 2019 mailbox servers (2 servers in a DAG) using nginx free edition using the streams capability. I am aware that this is only a Layer 4 solution, and hence doesn't terminate the connection or do any traffic inspection at all. I am OK with this limitation. However, some colleagues have advised against using nginx, but don't have reasons to offer other than "nginx free doesn't work with Exchange" (which is at least somewhat untrue). Am I going to run into issues down the road? Should I instead use haproxy? (Kemp LoadBalancer also looked interesting, but is pricey unless you use the free version, which is limited to 20Mb/s). My top priority is stability/reliability. Well, I guess my real top priority is price (I have little to no budget for this).

Best Answer

Now that I've prototyped HAProxy, I can't believe how much better it is than nginx free for load balancing. Active health checks, a nice stats interface, much better default logging, and much more. With just an hour of tuning, I am observing much faster reconnection of my Outlook clients after a server failure than I was able to achieve with nginx with days of experimentation and tuning. HAProxy also offers a free path forward if I want to move to reverse proxying Exchange vs just load balancing it.

I do want to emphasize that nginx free DOES work (the numerous claims that free doesn't load balance TCP and UDP are wrong), but I believe HAProxy to be a much better solution for this application.