您的位置:首页 > 运维架构 > Nginx

nginx 配置多个目录

2015-09-17 16:56 656 查看
<pre name="code" class="python">    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目录,否则报错.



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: