server {
listen 80;
server_name www.site.ru;
rewrite ^ http://site.ru$request_uri?;
}
server {
listen 80;
server_name site.ru;
root /var/www/site.ru;
index index.php;
charset UTF-8;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/x-javascript;
access_log /var/log/nginx/site.ru.access.log;
error_log /var/log/nginx/site.ru.error.log;
location /nginx_status {
stub_status on;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php;
fastcgi_param SCRIPT_FILENAME /var/www/site.ru$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /var/www/site.ru;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ ^/(status|ping)$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
allow 127.0.0.1;
deny all;
}
}
Вот пример одного из конфигов. Для каждого сайта - свой,и аналогичный