Nginx – how to set the nginx root path to a direcoty outside the ngnix dir

nginx

How would one set the root path of an nginx server to a direcoty outside the ngnix folder?

Currently ngnix is here:
c:/ngnix

I would like c:/www to be the root.

currently with
server
{
listen 80;
server_name localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;
    root  c:/www;
    location / {
        index  index.html index.htm;
        autoindex on;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

Best Answer

The root option could be inside the location block. Try:

    location / {
        root   c:/www;
        index  index.html index.htm;
    }