Nginx PHP fpm forbidden 原因

可能是标红目录层级不一致

location / {
root /var/www/html/public;
index index.php;
}

location ~ .php$ {
root /var/www/html/public;
fastcgi_pass fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

原文地址:https://www.cnblogs.com/wangshuyi/p/8612497.html