The following works for me:
location /blog/ {
index index.php;
# WordPress pretty URLs: (as per dominiek.com)
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last;
# Enable nice permalinks for WordPress: (as per Yawn.it)
error_page 404 = /blog/index.php?q=$uri;
}
I have my blog here: http://www.trk7.com/blog/
and my permalink structure is: /%postname%/