Compiling Nginx with Phusion Passenger on OSX

April 29th, 2009 | Design & Development | No Comments »

It took me a little while to get passenger set up with Nginx because I wanted to compile Nginx separately instead of using the tool provided with the passenger gem. I have it all working now so here’s how I did it. I’m running OSX Leopard but this should be fine on any Linux distro too.
Read on »

Getting WP-Super-Cache to work with Wordpress on Nginx

February 5th, 2009 | Design & Development | No Comments »

I was setting up WP-Super-Cache yesterday when I ran into this gotcha, I’ve done this before so I should have known better, I’m blogging it now so that I don’t forget and anyone else with this issue can be saved some hassle.

Essentially WP-Super-Cache was only half on, it could generate wp-cache files but was not creating static cache files.  The reason for this was that the querystring always contained at least one value even though it wasn’t in my URLs. That drove me crazy until I remembered this morning that the recommended Nginx setup was the problem the last time. The reason for this is the following part of the Nginx config that rewrites any non existing file requests to Wordpress’ index.php


if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}

This will cause WP-Super-Cache to never generate any static cache files since one of its conditions for doing so is that the querystring is empty.
If your Nginx config has this, try changing removing the ?q=$1 as below:


if (!-e $request_filename) {
rewrite ^(.+)$ /index.php last;
}