02.nginx静态资源服务器添加多个访问路径

标题什么意思呢?原本在nginx只有一个浏览器可以访问的借口,现在由于需要,需要增加一个,原本nginx.config是这样的

1
2
3
4
5
6
7
8
9
10
server{
listen 80;

server_name ip;
location /html/{
root /data/www/hexo/; #网站目录
# autoindex on;
index index.html; #默认首页
}
}

如何增加一个浏览器可以访问的url,比如访问我云服务器下的/data/www/hexo/js//360浏览器/的文件,直接新建server对象(姑且这么称呼)吗?测试,不对,直接在原本的server增加location

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
server{
listen 80;

server_name ip;
location /html/{
root /data/www/hexo/; #网站目录
# autoindex on;
index index.html; #默认首页
}
location /360浏览器/{
root /data/www/hexo/js/; #网站目录

# autoindex on;
​ index index.html; #默认首页
​ }

}

测试

fullpage插件实现的浏览器