nginx 配置多个目录

    server {
        listen       8001;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;


        location / {
            root /t/deploy/zjdev/deployedApps/zjzc-web-frontEnd/;
            index  index.html index.htm;
        }

        location /backoffice  {
            root /t/deploy/zjdev/deployedApps/zjzc-web-backoffice/;
            index  index.html index.htm;
        }

        #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;
        }

    }

}
~ 
root:则是指定目录某个目录的父目录,如:
locate /hello/ {
root /a/;
}
那么在/a/目录下必须有一个hello目录,否则报错.


 
 

你可能感兴趣的:(nginx)