Multiple sites with pretty permalinks with nginx

For the multiple sites to work you need to give each a separate server entry. Think of it the same way Apache vhosts work.

You need to specify a document root and server name for each domain or use the $host alias. It is also a good idea to create a hosts file entry on your local machine to correspond with each domain name so this: http://192.168.2.250/ourcompanywebsite would become: http://ourcompanywebsite

Example server file loaded via an include from nginx.conf

server {
    listen 80;
    server_name ourcompanywebsite firstclientwebsite secondclientwebsite;       
    root /usr/share/nginx/www/$host;
    error_log /var/log/nginx/error.log;

    include global.restrictions.conf;
    include global-wp.conf;
}

global-wp.conf

   #The section below contains your WordPress rewrite rules.
   location / {
          try_files $uri $uri/ /index.php?q=$uri&$args;
    }

  fastcgi_intercept_errors off;
  location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
    expires max;
    add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
 }

location ~ \.php {
    try_files $uri =404; #This line closes a big security hole
                         #see: http://forum.nginx.org/read.php?2,88845,page=3
    fastcgi_index index.php;
    include fastcgi_params;

    fastcgi_pass 127.0.0.1:9000;
}    

global.restrictions.conf

# Global restrictions configuration file.
# Designed to be included in any server {} block.</p>
location = /favicon.ico {
    log_not_found off;
    access_log off;
}

location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}

# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
    deny all;
    access_log off;
    log_not_found off;
}

For more detailed information on a complete Nginx with WordPress setup see my tutorial: WordPress Performance Server – Debian “squeeze” with Nginx, APC and PHP from the Dotdeb repos

*Note: Nginx with php-fpm is much better performance wise than using Apache as a backend proxy unless you have a huge list of 301 and 302 redirects.

error code: 523