server {
listen 80;
server_name domain.ru;
root /var/www/domain.ru;
access_log /data/logs/nginx/domain.ru.access.log main;
error_log /data/logs/nginx/domain.ru.error.log;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov|xml|flv|f4v)$ {
add_header Cache-Control public;
expires 24h;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
pm = static
pm.max_children = 60