nginx 配置多个目录

来源:互联网 发布:一天1000单词 知乎 编辑:程序博客网 时间:2024/05/19 13:14
<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目录,否则报错.


                                             
0 0
原创粉丝点击