server {
listen 80;
server_name domain.ru www.domain.ru *.domain.ru;
if ($http_host != domain.ru ) {
return 301
http://domain.ru$request_uri;
}
location ~* ^.+\.(jpg|ico|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|htm)$ {
root /home/domain/data/www/domain.ru/current/frontend/web;
access_log off;
expires 4M;
}
root /home/domain/data/www/domain.ru/current/frontend/web;
access_log /home/domain/data/www/domain.ru/prod.access.log;
error_log /home/domain/data/www/domain.ru/prod.error.log;
index index.php index.html index.htm;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ .(php|phtml)$ {
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
fastcgi_pass 127.0.0.1:9021;
fastcgi_index /index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
try_files $uri =404;
}
location ~ /\.ht {
deny all;
}
}