nginx的反向代理和负载均衡

方向代理

把监听到的http://localhost:80/api/反向代理到 http://webservers/admin/

shell 复制代码
   # 反向代理,处理管理端发送的请求
   location /api/ {
       #proxy_pass   http://localhost:8080/admin/;
       proxy_pass   http://webservers/admin/;
   }

负载均衡

反向代理到 webservers 按照一定的权重进行负载均衡了

shell 复制代码
	upstream webservers{
	  server 127.0.0.1:8080 weight=90 ;
	  server 127.0.0.1:8088 weight=10 ;
	}

负载均衡策略

相关推荐
xingyuzhisuan2 小时前
网络 Token 常见故障原理,基础排查科普
运维·服务器·网络·php
APIshop3 小时前
Python 获取 1688 商品采集 API 接口 | 工厂货源自动化对接商品信息 | 无需选品
运维·python·自动化
wljy13 小时前
二、进制状态转换
linux·运维·服务器·c语言·c++
handler013 小时前
【MySQL】常用命令总结(库与表增删查改)
运维·数据库·mysql·命令·总结
week@eight3 小时前
Linux - Doris
linux·运维·数据库·mysql
看到代码头都是大的4 小时前
CentOS环境下手动升级openssl、openssh
linux·运维·centos
浮生若城4 小时前
Linux——Ext系列文件系统
linux·运维·服务器
ITyunwei09874 小时前
主流 SaaS 工单系统对比
运维·服务器·人工智能
weixin_548444265 小时前
爆红处理APK 自动化编译流水线 v2026(英文名:APK AutoPipeline)
运维·自动化
枳实-叶5 小时前
【Linux驱动开发】第16天:按键中断完整实战
linux·运维·驱动开发