path:/etc/nginx/sites-available
配置虚拟域名
server{
listen 80;
server_name faceDistinguish.com ;
index index.php; #默认首先访问文件
root /usr/website/faceDistinguish/public;
autoindex on;
location ~ \.php$ {
root /usr/website/faceDistinguish/public;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME /usr/website/faceDistinguish/public/$fastcgi_script_name;
include fastcgi_params;
}
}
完整laravel nginx部署 参考https://laravel-china.org/topics/2914