server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
server_name dev.xxxxxx.ru www.dev.xxxxxx.ru;
root /var/www/dev.xxxxxx.ru/api/web;
index index.html;
access_log /var/log/nginx/dev-xxxxxxx-access.log;
error_log /var/log/nginx/dev-xxxxxxxx-error.log;
location /_next/static {
root /var/www/dev.xxxxxxxx.ru/next-app;
add_header Cache-Control "max-age=31536000";
}
location / {
root /var/www/dev.xxxxxxxxx.ru/next-app;
try_files $uri.html $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
location /api {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
try_files $uri =404;
}
}