server {
    listen 80;
    server_name foo.com;

    root /path;
    index index.html index.htm index.php;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri =404;

        include fastcgi.conf;
        fastcgi_pass 127.0.0.1:9000;
    }
}

nginx 1.12 配置解析php

 


参考:https://huoding.com/2013/10/23/290

http://blog.csdn.net/dengjiexian123/article/details/53358452