server {
listen 80;
server_name domain1.com domain2.com domain3.com;
charset utf-8;
location / {
root /home/www/domains;
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^/photos/(.*)/(.*)$ /photos/domain1/$1/$2 break;
rewrite ^/photos/(.*)/(.*)$ /photos/domain1/$1/$2 break;
rewrite ^/photos/(.*)/(.*)$ /photos/domain3/$1/$2 break;
rewrite ^/([^/]*)/([^/]*)/$ /index.php?do=$1&type=$2 last;
rewrite ^/([^/]*).html/([^/]*)/$ /index.php?do=$1&page=$2 last;
rewrite ^/([^/]*)/([^/]*).html$ /index.php?do=$1&point=$2 last;
rewrite ^/([^/]*).html$ /index.php?do=$1 last;
rewrite ^/([^/]*)/$ /index.php?do=$1 last;
rewrite ^/sitemap.xml /sitemap.php last;
}
}
location ~ \.php$ {
root /home/www/domains;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/domains$fastcgi_script_name;
include fastcgi_params;
}
}