<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目录,否则报错.
nginx 配置多个目录
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:nginx + mongodb
下一篇:nginx 只允许指定IP访问

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
如何用Nginx和ModSecurity保护您的网站
在没有商业WAF的情况下,如何用Nginx和ModSecurity保护您的网站
nginx modsecurity 安全 waf 防护 -
教你几个部署多个nginx-ingress的注意事项
一文带你掌握部署多个nginx-ingress的关键注意事项。
nginx 容器 nginx-ingress