Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just wondering if it is possible to have nginx, apc, memcached, and varnish all running together. i am currently running on a dreamhost private virtual server, not that it matters. any input would be greatly appreciated.

share|improve this question
up vote 1 down vote accepted

Yes, it is. It will get a little crowded and maybe memcached will not have much to do but it is possible.

 Varnish -> Nginx (php, apc, fastcgi probably) -> memcached ?

is it that you are intending?

share|improve this answer

We currently do this in our environment. Specifically:

nginx -> varnish -> apache (with memcached & apc installed). We do this on a RHEL5 box (64bit).

  • nginx runs on port 80 and acts as a proxy for varnish
  • varnish runs on another internal port which acts as a reverse proxy for apache
  • apache is running on another internal port

We added the nginx layer mainly to provide gzip compression on the outgoing requests. It works really well.

One tricky part is keeping the real IP of the initial client all the way down to the apache layer. We achieved this by implementing some custom headers in Varnish's VCL

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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