在Nginx配置中添加try_files指令,将所有请求重定向到index.html:

server {
    listen       80;
    server_name  yourdomain.com;
    root         /path/to/your/vue/dist;

    location / {
        try_files $uri $uri/ /index.html;
    }
}

标签: none

© 2025 GarinJのBlog. 由 Typecho&Garin 强力驱动.