# A few basic questions

**URL:** <https://www.ruby-forum.com/t/a-few-basic-questions/185947>\
**Category:** NGINX\
**Created:** [March 29, 2010, 4:50pm UTC](https://www.ruby-forum.com/t/a-few-basic-questions/185947 "2010-03-29T16:50:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [March 29, 2010, 4:50pm UTC](https://www.ruby-forum.com/t/a-few-basic-questions/185947/1 "2010-03-29T16:50:16Z")

</div>

Hi All;

The company I work for is moving to a drupal content management system.  
We expect to install a caching reverse proxy between the drupal servers  
and the Internet. I’m looking into nginx and varnish for that role.

There’s no question nginx provides for at least a basic high-speed  
caching reverse proxy, but I’d appreciate input from people using it  
with regards to these features:

1. Flexible health-checks of back-end web servers. Can I configure  
nginx to accept a 503, for example, as an acceptable return code? Can I  
specify a different health-check page for each back-end server?

2. Flexibility in load balancing. Can I specify anything other than  
round-robin? Least connections, lowest load, that sort of thing?

3. Ability to purge or invalidate selected pages. For example, a user  
logs in and updates a page that’s currently cached. Can I  
remove/overwrite that particular page in an nginx caching proxy?

4. Any other words of wisdom regarding nginx vs varnish?

Thanks in Advance,

— David

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [March 31, 2010, 12:04am UTC](https://www.ruby-forum.com/t/a-few-basic-questions/185947/2 "2010-03-31T00:04:42Z")

</div>

On Mon, Mar 29, 2010 at 10:47 AM, David M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi All;
> 
> The company I work for is moving to a drupal content management system. We  
> expect to install a caching reverse proxy between the drupal servers and the  
> Internet. I’m looking into nginx and varnish for that role.

nginx is generally used to speed up php with fastcgi, good idea with  
drupal  
varnish won’t speed up server performance in the same way but will  
help with scale, and is excellent when combined with nginx

> There’s no question nginx provides for at least a basic high-speed caching  
> reverse proxy, but I’d appreciate input from people using it with regards to  
> these features:
> 
> 1. Flexible health-checks of back-end web servers. Can I configure nginx to  
> accept a 503, for example, as an acceptable return code? Can I specify a  
> different health-check page for each back-end server?

I know varnish has configurable health checks, more relevant to see  
how nginx is doing.

> 1. Flexibility in load balancing. Can I specify anything other than  
> round-robin? Least connections, lowest load, that sort of thing?

Priority is assignable, and health checks remove servers from the pool  
in varnish.

> 1. Ability to purge or invalidate selected pages. For example, a user logs  
> in and updates a page that’s currently cached. Can I remove/overwrite that  
> particular page in an nginx caching proxy?

nginx and varnish update on any change; varnish can be set to cache  
longer to delay updates, not sure about nginx.

> 1. Any other words of wisdom regarding nginx vs varnish?

nginx is a better server; it will run your php app the best. varnish  
is a better cache to override server settings and direct client  
browsers better.

Stef

* * *

Stefan C.  
toll-free: +1 800 224 0192  
Skype: stefan.caunter

[http://mapguy.ca](http://mapguy.ca)
