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 ;
	}

负载均衡策略

相关推荐
biubiubiu070611 分钟前
Vibe Coding
运维
学不完的1 小时前
ZrLog 高可用架构监控部署指南(Prometheus + Grafana)
linux·运维·架构·负载均衡·grafana·prometheus·ab测试
北京智和信通1 小时前
可视・可管・可靠:智和信通赋能清华某院构建新一代监控运维平台
运维·网络监控·网管软件·信创运维·高校网络运维·高校网管
Sean‘1 小时前
AKS 集群离线部署 kube-state-metrics 文档
运维·docker·容器
liucan20122 小时前
nginx服务器实现上传文件功能_使用nginx-upload-module模块
服务器·前端·nginx
cyclejune2 小时前
5 个本地 AI Agent 自动化工作流实战
运维·人工智能·自动化·clawdbot·openclaw
Johnstons2 小时前
2026企业网络流量监控与分析工具对比
运维·网络·数据库·网络流量监控·网络流量分析
IMPYLH3 小时前
Linux 的 dirname 命令
linux·运维·服务器·数据库
桌面运维家4 小时前
DHCP监控:IP冲突诊断与网络稳定运维实战
运维·网络·tcp/ip
石头猫灯4 小时前
DNS 服务器配置实验
运维·服务器