修改nginx默认web目录的求助

2025-02-25 14:53:41
推荐回答(1个)
回答1:

你可以修改nginx配置里的root,比如下面的代码路径是到/data/www读取:

server {
        listen       80;
        server_name  test.abc.com;
        root /data/www;
        index index.php;
        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;
        }
}