Hacker News new | ask | show | jobs
by genwin 5095 days ago
Why do you use a web server (Nginx) in front of other web servers? I'm pretty new to this. Thanks.
2 comments

I've seen situations where nginx sits in front of Apache and serves static files directly, but proxies requests for PHP through to Apache for easier setup.
As described, static or lighttpd for static and reverse proxy for the domain achieves more than one goal:

* you can serve page faster; * you can mix on a same domain more than one app from different servers in the DMZ (for sharing domain based mechanism (flash, Cross site ajax) by rewriting the url; * you can have one front (nginx) and several servers, which with heartbeat mechanism can handle failover. * you could (when ssl certificate were only IP based) share one SSL certificate for more than one back (VIP)

It is a pretty low cost quite scalable architecture. I guess you could do it with apache, but I dropped apache since its licence is as understandable as its configurations.