Which - HAPROXY vs Nginx for load balancing websites w/SSL termination on the LB?
Posted by StartupTim@reddit | linuxadmin | View on Reddit | 3 comments
Hey all,
So I've read a bit about HAPROXY and Nginx and I'm curious which do you think would be best for my setup:
I will have 1 public server which is the load balancer. This server will need to terminate HTTPS/SSL and then balance between 2 web servers internal to that over normal HTTP, whereas those 2 web servers need to send traffic back out over HTTPS/SSL from the load balancer.
The web servers will be doing standard web content, php, cookie sessions, nothing fancy, though the key is that all traffic must be maintained over SSL, with SSL terminated on the load balancer. The web servers most likely will be Nginx due to performance. I will also be using the non-commercial/free versions of both.
So with that said, which should I choose, HAPROXY or Nginx? Any suggestions on pros/cons? Also, could anybody point me to the best configuration example/tips for doing this (load balancing w/SSL termination)?
Many thanks in advance!!
mickelle1@reddit
HAProxy is the best option for this. I have deployed it in this type of situation dozens of times and it is our standard load balancer solution. I can't say enough good things about it and our experience with it.
HAProxy is designed to be a robust load balancer (rather than a web server), it has hundreds of features (such as SSL termination), has outstanding documentation, and is incredibly resource efficient.
Feel free to ask if you have any other questions about this. :)
JuanGaKe@reddit
My two cents:
You're going to love the way you can just throw a list of certificates (one .pem file per line) on HAProxy:
bind *:443 ssl crt-list /etc/haproxy/pem-file-list.txt
And just very recently they've implemented direct backend routing to FastCGI (i.e. PHP with php-fpm) in 2.1 version. See here.
So you could switch from something like this for your php backend:
HAProxy -> Varnish cache -> Web server -> serve static files or php-fpm to serve php
...to this:
HAProxy -> directly route to php-fpm to serve php
rfc2549-withQOS@reddit
So, what about mod rewrite for pretty urls in WP?
do you have any examples handy?