server {
server_name test.com www.test.com;
ssi on;
set $root_path /var/www/html/test.com/public;
root $root_path;
index index.php;
charset off;
disable_symlinks if_not_owner from=$root_path;
access_log /var/log/test.com.access.log ;
error_log /var/log/test.com.error.log ;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @php;
}
try_files \$uri \$uri/ /index.php?$query_string;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf|js|woff2?|ttf|mp4|xml|m4v|pdf|docx?|xlsx?|psd|eps|txt|csv|map|json)$ {
expires 365d;
}
}
location @php {
try_files $uri =404;
fastcgi_index index.php;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@test.com";
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
include fastcgi_params;
}
listen 80;
}