Jenkins 微服务持续集成十四(Spring Cloud 微服务架构优化一:高可用生产部署服务器)
1. Docker2 服务器上安装 Nginx
192.168.10.115
参考:
安装 Nginx 服务器
2. 修改 nginx.conf
vim /etc/nginx/nginx.conf
......
include /etc/nginx/conf.d/*.conf;
upstream zuulServer{
server 192.168.10.50:10020 weight=1;
server 192.168.10.115:10020 weight=1;
}
server {
listen 85;
listen [::]:85;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://zuulServer/;
}
error_page 404 /404.html;
location = /404.html {
}
......
端口改成 85
systemctl enable nginx && systemctl start nginx
3. 修改前端项目的访问地址
使用小乌龟提交到 gitlab
查看
4. 构建前端工程
5. 访问前端页面
登录:admin/123456
PS:如果获取不到后端数据库信息更换浏览器并且清除历史缓存。