Custom Nginx logging format

I’m trying to figure out if my nginx proxy cache is working or not. Reference these pages to hopefully log cache hits and misses.

#I put this in my nginx vhost config file
log_format up_head ‘$remote_addr [$time_local]’ ‘upstream_cache_status $upstream_cache_status’;
#write log using the "up_head" format that I just defined.
access_log /path/to/log/access.log up_head;

Sample log output of the example defined above. [16/Jan/2011:20:22:25 +0000]upstream_cache_status HIT [16/Jan/2011:20:22:26 +0000]upstream_cache_status – [16/Jan/2011:20:22:26 +0000]upstream_cache_status – [16/Jan/2011:20:22:27 +0000]upstream_cache_status HIT [16/Jan/2011:20:22:28 +0000]upstream_cache_status – [16/Jan/2011:20:22:28 +0000]upstream_cache_status – [16/Jan/2011:20:22:45 +0000]upstream_cache_status HIT

nginx caching for wordpress and drupal

Use Boost module for Drupal and then copy some nginx rules.

Wordpress Nginx proxy cache integrator plugin. Rather doing a proxy to Apache, I proxy nginx back to itself on a different port that is running fastCGI for the PHP.

Get spawn-fcgi to work with nginx on ubuntu

This is what I used to setup a startup script for fastCGI to work with nginx. That allows me to run multiple wordpress blogs off my slicehost.

Once it is setup I can start/restart my FastCGI processes easily.

/etc/init.d/fastcgi start
/etc/init.d/fastcgi restart
/etc/init.d/fastcgi stop
Syndicate content