nginx中部署vue3注意事项
vite vue vue3 在nginx 根目录或非根目录中部署后刷新404或空白问题解决
nginx.conf新增一个location /你的文件夹名称 {},注意非root需要改使用alias,最后要在里面新增一条try_files $uri $uri/ /你的文件夹名称/index. html;这个是解决刷新报404的问题。
虚拟目录一定要加上
try_files $uri $uri/ /虚拟目录名称/index.html;

nginx.conf新增一个location /你的文件夹名称 {},注意非root需要改使用alias,最后要在里面新增一条try_files $uri $uri/ /你的文件夹名称/index. html;这个是解决刷新报404的问题。
虚拟目录一定要加上
try_files $uri $uri/ /虚拟目录名称/index.html;
