我是靠谱客的博主 神勇爆米花,这篇文章主要介绍宝塔 nginx 配置文件的存放目录配置vue的history模式,现在分享给大家,希望可以做个参考。

在项目中使用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模式的全部内容,更多相关宝塔内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(58)

评论列表共有 0 条评论

立即
投稿
返回
顶部