0

the all funciton of routing vue.js project is working well in local test.

However, this.$router.push method doesn't work when testing nginx server.

The nginx server has the proper configuration to route client-side rendering

/etc/nginx/nginx.conf

location / {
        try_files $uri $uri/ @rewrites;
}

location @rewrites {
    rewrite ^(.+)$ /index.html last;
}

It's very wired that this.$router.push doesn't work only.

The beforeEach method and direct link function properly.

Do you have the same experience about that and know any solution?

  1. logging before and after this.$router.push

this.$router.push must be called and the error doesn't be throwned.

  1. changing /etc/nginx/nginx.conf

I tried the serveral type of nginx.conf to forward index.html.

rewrites or others. It works well. However, this.$router.push only doesn't work.

New contributor
gyu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.