我需要在/上打开登陆页面,在/app上打开vueJS应用程序。下面是我当前的nginx设置:
server {
listen 80;
location /app {
alias /var/www/app/dist/;
try_files $uri $uri/ /index.html;
}
location / {
alias /var/www/landing/dist/;
try_files $uri $uri/ /index.html;
}
}它在/上打开着陆,当我去/app时打开vueJS应用程序,但是,如果我打开/app/login,它会打开登陆页面而不是vue应用程序。我做错什么了?
发布于 2017-12-06 18:49:55
我不知道为什么,但是将last添加到vue应用程序配置中解决了这个问题。下面是配置现在的样子:
server {
listen 80;
location /app {
alias /var/www/app/dist; # removed the / at the end
try_files $uri $uri/ /index.html last; # here is the trick
}
location / {
alias /var/www/landing/dist/;
try_files $uri $uri/ /index.html;
}
}https://stackoverflow.com/questions/47679208
复制相似问题