nginx配置微前端
前言
微前端
配置
]# mkdir -p /data/deploy/openresty/qiankun/conf.d
]# cd /data/deploy/openresty/qiankun
]# cat > default.conf <<-EOF
server {listen 80;server_name localhost;location / {try_files $uri $uri/ /index.html;root /usr/local/openresty/nginx/html/base;index index.html index.htm;}location ^~ /basic {try_files $uri $uri/ /index.html;alias /usr/local/openresty/nginx/html/basic;}location ^~ /equipment {try_files $uri $uri/ /index.html;alias /usr/local/openresty/nginx/html/equipment;}# location ^~ /(.*) {# try_files $uri $uri/ /index.html;# if $1 != "" then# # rewrite "/(.*)" "/usr/local/openresty/nginx/html/$1" last;# alias /usr/local/openresty/nginx/html/$1; # 或者使用:rewrite "/(.*)" "/usr/local/openresty/nginx/html/$1" last;# else# # rewrite "/(.*)" "/usr/local/openresty/nginx/html/base" last;# alias /data/web/qiankun/main; # 或者使用:rewrite "/(.*)" "/usr/local/openresty/nginx/html/base" last;# }# location ^~ /(.*) {# try_files $uri $uri/ /index.html;# if ($1 != "") {# # rewrite "/(.*)" "/usr/local/openresty/nginx/html/$1" last;# alias /usr/local/openresty/nginx/html/$1; # 或者使用:rewrite "/(.*)" "/usr/local/openresty/nginx/html/$1" last;# } else {# # rewrite "/(.*)" "/usr/local/openresty/nginx/html/base" last;# alias /usr/local/openresty/nginx/html/base; # 或者使用:rewrite "/(.*)" "/usr/local/openresty/nginx/html/base" last;# }# }error_page 500 502 503 504 /50x.html;location = /50x.html {root /usr/local/openresty/nginx/html;}}
EOF
]# cat > nginx.conf <<-EOF
pcre_jit on;error_log logs/error.log;events {worker_connections 1024;
}http {include mime.types;default_type application/octet-stream;access_log logs/access.log;client_body_temp_path /var/run/openresty/nginx-client-body;proxy_temp_path /var/run/openresty/nginx-proxy;fastcgi_temp_path /var/run/openresty/nginx-fastcgi;uwsgi_temp_path /var/run/openresty/nginx-uwsgi;scgi_temp_path /var/run/openresty/nginx-scgi;sendfile on;keepalive_timeout 65;include /etc/nginx/conf.d/*.conf;}
EOF
]# cat > docker-compose.yml <<-EOF
version: "3.5"
services:Qiankun:image: openrestycontainer_name: Qiankunhostname: Qiankunports:- 80:80 volumes:- /data/deploy/openresty/qiankun/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro - /data/deploy/openresty/qiankun/conf.d:/etc/nginx/conf.d:Z- /data/web/qiankun:/usr/local/openresty/nginx/html:Z- /data/volume/openresty/logs/qiankun:/usr/local/openresty/nginx/logs:Zrestart: alwaystty: true
EOF
- 注:查看前端文件主路径下的目录,其目录跟nginx配置路由有关
]# tree -d /data/web/qiankun
/data/web/std/qiankun
├── base
│ ├── icons
│ └── user
│ └── images
├── basic
│ ├── icons
│ └── user
│ └── images
└── equipment├── icons├── static└── user└── images
结语
Vue+微前端(QianKun)落地实施和最后部署上线总结
nginx配置微前端相关推荐
- Vue项目打包部署Nginx配置及前端缓存问题解决
目录 1.部署单个站点 2.部署多个站点 3.缓存问题解决 1.部署单个站点 配置如下 server {listen 80;server_name localhost;location / {root ...
- nginx配置和前端跨域问题
本文使用的是ubuntu版本的,使用的是解压版安装的http://nginx.org/en/download.html上可以获取当前最新的版本. 解压缩nginx-xx.tar.gz包. 进入解压缩目 ...
- 微前端框架SingleSpa Vue实践
一.主应用 1.npm i single-spa 安装single-spa: 2.main.js同级目录增加single-spa的配置文件single-spa-config.js: // single ...
- 爱奇艺号微前端架构实践
前言 近来,微前端的概念非常火爆,那么什么是微前端架构?微前端架构是一种架构风格类似于微服务的架构,它将微服务的理念应用于浏览器端,即将 Web 应用由单一的单体应用转变为多个小型前端应用聚合为一的应 ...
- 爱奇艺基于 Vue 的微前端架构实践
点击上方"开发者技术前线",选择"星标" 18:50 在看 真爱 来自:爱奇艺技术产品团队 前言 近来,微前端的概念非常火爆,那么什么是微前端架构?微前端架构是 ...
- qiankun 传统项目配置_微前端 qiankun 项目实践
原标题:微前端 qiankun 项目实践 作者:zxh1307 https://juejin.im/post/5ea55417e51d4546e347fda9 导语 最近在做微前端的项目 , 过程中真 ...
- qiankun 传统项目配置_前端微服务
见内容 解决的问题 常见讨论 观点:微前端的核心价值在于 "技术栈无关" 微前端的公司,基本上都是做 ToB 软件服务的,没有哪家 ToC 公司会有微前端的诉求,因为很少有 ToC ...
- nginx配置前端反向代理
本地这里有两个端口: 8080:前端页面 80:后端接口 在nginx配置 listen 8888;server_name 127.0.0.1;location / {root html;proxy_ ...
- 部署前端项目 Linux系统的nginx配置
为什么80%的码农都做不了架构师?>>> 一.本地文件上传到服务器 scp -r /c/Develop/manage-system/dist/* username@server ...
最新文章
- Python+Dash快速web应用开发——基础概念篇
- (原創) 如何正確的使用迴圈(使用for_each)? (C/C++) (STL) (template)
- 成功从小公司跳槽!35岁的程序员被裁
- 动物和计算机-自组织是悬空的钢丝
- vscode中如何创新建php文件,php – 如何在Visual Studio Code,UNIX中的所有文件中创建所有行结尾(EOL)?...
- 活在贫困线之下的开源软件项目——开源的可持续性斗争
- spring security oauth2_SpringBoot2 整合OAuth2实现统一认证
- Java基础学习总结(86)——Java异常处理机制Exception抛出异常时throw和throws用法详解
- 吴恩达深度学习2.3笔记_Improving Deep Neural Networks_超参数调试 和 Batch Norm
- 湖南区块链服务网络(BSN)门户运营商确定
- LCP 13. 寻宝
- 12.15daily_scrum
- t470换屏线_硬件笔记之Thinkpad T470P更换2K屏幕
- R语言生成三维立体图
- 旧手机改电脑外挂,文本补充
- OpenEmbedded 简介
- 适合所有手环的app_Redmi Watch体验:手环终结者?
- facsum (线性筛 积性函数)
- 计算机Excel怎么弄迷你图,【迷你图excel在哪里】Excel如何绘制迷你图
- android 编译WVGA
热门文章
- 3.8编写程序 ,要求用户从键盘输入一个年份,程序输出改年出生的人的生肖。中国生肖基于12年一个周期,Java
- python: 内建函式round() 是四舍五入还是五舍六入?
- 在电商平台落地大数据应用的6个场景、2类服务、12个框架
- 完美删除Mac Os自带输入法
- Redis深入浅出—hash、set
- scuba 报表_是否想了解JavaScript的for循环? 这个动画的SCUBA潜水员可以提供帮助!...
- CAD软件几何数据存储原理
- 微软反linux广告图片,一张地铁站“前程无忧广告”的图片引发网友热议 官方:虚假图片...
- Hexo更换主题教程
- 喜马拉雅随车听开通啦