栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

vue + nginx 反向代理配置方法二

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vue + nginx 反向代理配置方法二

1、vue.config.js
设置publicPath路径为反向代理路径:
publicPath: ‘/test/’,

module.exports = {


// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false,
//打包app时放开该配置
//publicPath:'./',
 publicPath: '/test/',
 }
devServer: {
  port: 3000,

2、nginx反向代理 test路径
location /archive {
#root html;
#index index.html index.htm;
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
client_max_body_size 220m;
proxy_pass http://192.168.1.65;
}

3、

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/675944.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号