システム: OS :/usr/local/etc/nginx/nginx.conf
nginx デフォルトのroot:/usr/local/opt/nginx/html
1. nginxをインストールします。私はbrew
brew install nginx
2 .php-fpmを起動します
sudo php-fpm
3. nginx.conf を開きます
php コメントを有効にして独自の root を設定します
location ~ \.php$ { root /Users/maming/php; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
Note
SCRIPT_FILENAME /script$fastcgi_script_name;
を
に変更する必要があります
SCRIPT_FILENAME $document_root$fastcgi_script_name;
4. nginx を開始します
rreeまたは再起動