Run CGI on nginx using thttpd as a proxy

I basically followed the instructions here but adapted the proxy to my own needs.

Using ImageCache with nginx

I couldn't get the ImageCache module for Drupal to work for the longest time because I didn't realize that the module came with a .htaccess file that pushes the image load back through Drupal to calculate the caching properly. Knowing this I was able to find this magical chunk for your nginx.conf (or your virtual host config). Slip this code in near the static serve file command

# imagecache needs to have php read any files that it's planning to manipulate
location ^~ /sites/default/files/imagecache/ {
     index  index.php index.html;
     # assume a clean URL is requested, and rewrite to index.php                                                                 
      if (!-e $request_filename) {
          rewrite  ^/(.*)$  /index.php?q=$1  last;
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
    access_log        off;
    expires           30d;

Reference: PHP5 FastCGI config for nginx on Ubuntu and clean URLs

I was trying to figure out how to get a wordpress blog up and running on my slicehost slice real fast but I don’t know anything about nginx or FastCGI.

Serving PHP5 with Nginx on Ubuntu 7.10 turned out to be a good step-by-step that provided all the info I needed. Thanks Mr. Blogger!

For SEO purposes I also needed some clean URLs. nginx does not do .htaccess files so you have to setup the nginx config yourself. nginx rewrite rules for wordpress worked for me. Thank you too Mr. Blogger!

I added this to my location block {}.

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

Syndicate content