Nginx+php5.3防止跨目录访问

    Nginx各虚拟站点的配置文件中加入

    /etc/nginx/conf.d/站点配置文件.conf

    加入此内容fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/";

    location ~ \.php$ {
    root /home/www;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/";    #在此处加入
    include fastcgi_params;
    }

    转载请注明:RAIN MAN » Nginx+php5.3防止跨目录访问

    喜欢 0
标签: , ,

还没有人抢沙发呢~