On many production setups, I have often seen people using both Nginx and Apache together - Often configured as Nginx listening on port 80 and "passing on" the traffic to Apache listening on port 8080.

I've tried to Google around a lot but I have not been able to figure out what benefits does this kind of an architecture have compared to just running Apache on port 80 and serving all the traffic directly?

Can someone help?


In my experience that setup is used when Apache serves as an application server with mod_php or mod_perl. In that case nginx is used for SSL termination and serving static content (and possibly also as a cache), while all application requests are passed on to Apache.

  • If I am using a CDN for static assets, I suppose the first hit for that asset would be served via Nginx (which is faster than Apache) but from then on the hits will directly be served via the CDN. Neither Apache nor Nginx would play a role, am I right? Does this still improve site speed significantly? – Gaurav Gupta Nov 25 '15 at 4:01
  • With a CDN that benefit certainly decreases. (I cannot quantify how much and whether that setup is still useful with a CDN.) – mschuett Nov 25 '15 at 8:46

In this setup, nginx could be used for SSL offload - which is, in my experience, faster than apache at SSL. It can also be used to load balance several upstream apache servers, but this usually means it is on a separate server.


Apache can solve some problems like Webdav/SVN by added some modules. NGinx can't do that and then proxy the request to Apache.


Nginx is faster and more stable at High-Load but do not handle htaccess files. So you use Nginx as Webserver and Apache as Application Server.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.