Если кто-то столкнется с такой же проблемой, то решение вопроса ниже
server {
server_name test.ru;
rewrite ^ http://www.test.ru$request_uri? permanent;
}
server {
listen 80;
server_name www.test.ru;
root /sites/test_ru/public/www;
index index.php;
location ~* \.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|ico|css)$ {
expires max;
}
location / {
expires off;
try_files $uri $uri/ @kohana;
}
location ~* \.php$ {
try_files $uri $uri/ @kohana;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME /path/to/fastcgi_script_name;
include fastcgi_params;
}
location @kohana {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}
}