We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
plugin-vue
plugin-vue-jsx
vite 打包默认base 是/ 如果用户放在某个目录下,通过目录路径访问不到 ,必须打包时指定目录名称,用户在以相同的目录命名 如何打包能,不管用户命名什么样的目录,都能通过路径 + 自定义目录名访问项目
我使用nginx 配置,第一个locaction能访问到 , 第二个location如何访问都访问不到 ,只要/后面带路径名的,在本地直接访问dist目录只显示文件
location / { root /usr/local/nginx/html/home; try_files $uri $uri/ /index.html; }
location /backend { rewrite ^/backend/(.*)$ $1 break; # alias /usr/local/nginx/html/backend/; # root /usr/local/nginx/html/backend; # root /usr/local/nginx/html/home; # try_files $uri $uri/ /index.html; index index.html; }
No response
The text was updated successfully, but these errors were encountered:
已经解决
Sorry, something went wrong.
No branches or pull requests
Related plugins
plugin-vue
plugin-vue-jsx
Description
vite 打包默认base 是/
如果用户放在某个目录下,通过目录路径访问不到 ,必须打包时指定目录名称,用户在以相同的目录命名
如何打包能,不管用户命名什么样的目录,都能通过路径 + 自定义目录名访问项目
Suggested solution
我使用nginx 配置,第一个locaction能访问到 , 第二个location如何访问都访问不到 ,只要/后面带路径名的,在本地直接访问dist目录只显示文件
location / {
root /usr/local/nginx/html/home;
try_files $uri $uri/ /index.html;
}
location /backend {
rewrite ^/backend/(.*)$ $1 break;
# alias /usr/local/nginx/html/backend/;
# root /usr/local/nginx/html/backend;
# root /usr/local/nginx/html/home;
# try_files $uri $uri/ /index.html;
index index.html;
}
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: