Nginx 更改文档根目录

Sti*_*ers 3 nginx

我正在使用Nginx For Windows的 Windows 安装文件

但是它不允许更改安装位置,所以它默认为C:\nginxIs there a way to update the config file to change the root directory to D:\blabla?

示例代码来自 nginx.conf

server {
    listen       80;
    server_name  localhost;

    location / {
        root   html;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
}
Run Code Online (Sandbox Code Playgroud)

VBa*_*art 5

-p启动nginx时使用该参数:

nginx -p "D:\blabla"
Run Code Online (Sandbox Code Playgroud)