server
{
# Порты
listen 80;
disable_symlinks if_not_owner from=$document_root;
root /var/www/example_ru/data/www/test.example.ru;
index index.php index.html index.htm;
server_name test.example.ru;
client_max_body_size 30m;
location / {
access_log /var/log/nginx/access-01.log main;
try_files $uri $uri/ /index.php?cat_name=$uri&$args;
expires 72h;
}
location ~ \.php$ {
access_log /var/log/nginx/access-02.log main;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_split_path_info ^(.+?\.php)(/.*)?$;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param PATH_TRANSLATED $document_root/index.php;
#fastcgi_param QUERY_STRING cat_name=$uri&$args;
fastcgi_param QUERY_STRING cat_name=$request_uri; # это, по идее, то же самое, что и предыдущая строка.
# См. http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
}
}