mac nginx php php-fpm

#the php-fpm config and cammand...

cp /private/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf

php-fpm --fpm-config /usr/local/etc/php-fpm.conf --prefix /usr/local/var

ps aux | grep 'php-fpm'

killall -HUP php-fpm

 

#the nginx config and cammand...

brew services restart nginx

fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
=====>
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

 

可以在你的location php 里面添加当文件不存在时返回404而不是交给php-fpm进行处理

location ~ \.php$
{
...
#文件不存在转404
try_files $uri = 404;
...
}

然后,在你的配置文件中找到下面这段

fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

posted @ 2018-01-23 12:02  会飞的斧头  阅读(450)  评论(0编辑  收藏  举报