Nginx - 在主机的所有页面上包含PHP脚本

时间:2014-09-26 15:56:34

标签: php nginx

是否可以使用Nginx自动将PHP文件包含到所有网站?如果是这样我该怎么办? E.G。

server {
    listen       80;
    server_name  example.coom;
    location / {
        root   html;
        index  index.php;
    }
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME c:/nginx/html/$fastcgi_script_name;
        include        fastcgi_params;
        include        ../includes/def.php;
    }
}

0 个答案:

没有答案