I need to open the landing page on /
, and vueJS application on /app
. Here is my current nginx setup:
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;
}
}
It opens landing on /
, and vueJS app when I go to /app
, however, if I open /app/login
it goes to landing page instead of vue application. What am I doing wrong ?
I have no idea why, but adding last
to vue application configuration fixed it. Here is how the config looks now:
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;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With