server {
    listen 80;
    server_name localhost;
    index index.html index.php;
    root /var/www/build;

    location / {
        # fastcgi_pass   127.0.0.1:9000;
        # fastcgi_index  index.php;
        # include            fastcgi_params;

    }

    location ~ \.php$ {
     fastcgi_pass   127.0.0.1:9000;
     fastcgi_index  index.php;
     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
     include            fastcgi_params;
    }

}


# typeccho配置
server {
    listen 80;
    # server_name localhost;
    index index.html index.php;
    root /var/www/build;

    # location ~ \.php$ {
    location ~ .*\.php(\/.*)*$ {
         set $path_info "";
         set $real_script_name $fastcgi_script_name;
         if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                 set $real_script_name $1;
                 set $path_info $2;
         }
         fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
         fastcgi_param SCRIPT_NAME $real_script_name;
         fastcgi_param PATH_INFO $path_info;
         fastcgi_pass   127.0.0.1:9000;
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
         include            fastcgi_params;
    }

}


备份地址: 【nginx配置php-fpm