Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running nginx infront of a unicorn or gunicorn under Elastic Load Balancer

I have a very simple question. Nginx does reverse proxy buffering for HTTP servers like Gunicorn and Unicorn. However if I have a Elastic Load Balancer (offered by Amazon Web Services also known as -- ELB) is there any point in running nginx in front of my app server?

 Request----> ELB -------> NGINX-------> UNICORN/GUNICORN HTTP SERVER
like image 533
deadlock Avatar asked Jun 12 '13 15:06

deadlock


1 Answers

In a word: yes. Amazon's ELB service is wonderful, but it is solely a load balancer. Running nginx on your own server gives you a locus of control and a place to do rewrites, redirects, compression, header munging, caching, and more. Furthermore it allows you to serve static files in the fastest possible way, rather than using a slot on your more heavyweight appserver.

like image 118
Dave S. Avatar answered Oct 01 '22 15:10

Dave S.