在项目中使用vue
的history模式,需要配置文件,使用到宝塔面板的服务器。现在记录存放位置。
/www/server/panel/vhost/nginx
配置history模式
try_files $uri $uri/ /index.html qkbim/index.html;
配置跨域
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'POST,PUT,GET,DELETE';
add_header Access-Control-Allow-Headers 'version, access-token, user-token, Accept, apiAuth, User-Agent, Keep-Alive, Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With';
最后
以上就是神勇爆米花最近收集整理的关于宝塔 nginx 配置文件的存放目录配置vue的history模式的全部内容,更多相关宝塔内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复