Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue3项目history路由模式,nginx对应的配置 #5

Open
lr6 opened this issue Mar 6, 2024 · 0 comments
Open

Vue3项目history路由模式,nginx对应的配置 #5

lr6 opened this issue Mar 6, 2024 · 0 comments

Comments

@lr6
Copy link
Owner

lr6 commented Mar 6, 2024

server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

    root   /usr/share/nginx/html;
    index index.html index.htm;

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

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

这种模式下,打包之后dist目录下的文件夹名称和后端的api地址,都不能作为前端的路由。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant