前端微服务架构4-生产环境打包部署补充

生产环境使用同一个ip和端口部署父子应用,所以和本地运行有所区别,

区别1:主应用中子应用的注册:

复制代码
var apps = [
    {
        name: 'cw-wfw1',
        entry: '/child1/', //入口文件不同,本地为entry: '//localhost:10001',
     container: '#wfw1',
        activeRule: '/compliancePromotion',
        props: { 
            // routerBase: "/compliancePromotion" 
        }
    },
];
复制代码

 

区别2:子应用配置打包路径vue.config.js

publicPath: '/child1/',

 

3:nginx配置:打包文件的目录结构为在主应用的dist下添加child1文件夹,子应用的打包文件放在这里

    location /child1 {
            root   D://test/dist/;
            index  index.html index.htm;
            try_files $uri $uri/ /child1/index.html;
        }

 

posted @   曹伟666  阅读(34)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· winform 绘制太阳,地球,月球 运作规律
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示