服务端nginx配置示例
server {
root /var/www/your project/public;
index index.php;
server_name api.xxxxx.com;
charset utf-8;
client_max_body_size 20m;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param DD_TRACE_DEBUG true;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
前端nginx配置
server {
root /var/www/html/your project /production;
index index.html;
server_name www.xxxxx.com;
charset utf-8;
location / {
try_files $uri $uri/ /index.html;
}
}