前端 - nginx怎么部署多个多页面引用
伊谢尔伦
伊谢尔伦 2017-04-17 15:22:37
0
1
450

我有一个网站www.eee.com,还有两个单页面应用.一个react,一个vue的.
我想把其中一个单页面应用挂载到根目录,也就是wwww.eee.com下,把另外一个挂载到www.eee.com/admin下.

目前conf.d目录里的default.conf配置如下

server {
    listen 80;
    server_name localhost;
    location / {
        root /home/workspace/vue;
        index index.html;
        try_files $uri /index.html;
    }
    location /admin {
        root /home/wordspace/admin;
        index index.html;
        try_files $uri /index.html;
    }
}

根目录下的能正常访问,但是wwww.eee.com/admin下的无法访问.求解决之道

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
小葫芦

server {

listen 80;
server_name localhost;
location /admin {
    root /home/wordspace/admin;
    index index.html;
    try_files $uri /index.html;
}
location / {
    root /home/workspace/vue;
    index index.html;
    try_files $uri /index.html;
}

}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template