Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

We have a website and it's current architecture is as follows:

There's squid in the front which caches images. Then there is apache httpd with mod_rewrite enabled. httpd then talks to apache tomcat(with mod_jk) for dynamic requests and servers static stuff like js,css on it's own. Apache httpd rewrites clean urls to raw ones(with ugly url params) that tomcat deals with. There are over 100 rewrite rules in the mod_rewrite config. We also have certain php stuff that we hacked together to work with facebook. the php files are served by apache, but the load is significantly less.

So the goal is to able to cache static files(js,css,images) aggressively and give the dynamic stuff directly to tomcat. We need url rewriting(that probably can be done in tomcat itself), gzip/deflate support as well as support for php.

So, given our needs, can a caching server like squid/varnish be placed directly in front of tomcat to make this work or Would we need a web server like nginx/lighttpd in between because we need php ?

share|improve this question
up vote 1 down vote accepted

why not use apache/lighttpd as a proxy/caching server and php interpreter at the same time?

lighttpd as caching proxy:

apache as caching proxy:

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.