[wp-hackers] nginx server?

Kimmo Suominen kimmo at global-wire.fi
Fri May 2 14:42:02 GMT 2008


On Fri, May 02, 2008 at 09:32:03AM -0500, Otto wrote:
> Anybody running nginx with WP? Some people are wondering about the
> best way to configure it, and since WordPress.com switched to it, I
> figured maybe those people would have a few useful tips.
> 
> Reference: http://wordpress.org/support/topic/143668

I haven't figured the WP Super Cache part yet in my config, but this is
what I'm using for now.

  server {
    listen 80;
    server_name blog.example.com;
    access_log  /var/log/nginx/example.com.access.log;
    client_max_body_size 16m;

    location ~ \.php$ {
      fastcgi_pass   127.0.0.1:10000;
      fastcgi_index  index.php;
      fastcgi_param  SCRIPT_FILENAME  /www/example.com$fastcgi_script_name;
      include        /etc/nginx/fastcgi_params;
    }

    location / {
      root /www/example.com;
      index index.php index.html;

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

Adding WP Super Cache should just require two more tests for a file
existing.  The non-compressed case is easier, but I don't know off-hand
how to check the request headers for gzip acceptance.

Best regards,
+ Kimmo
-- 
<A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>



More information about the wp-hackers mailing list