技术栈

nginx upstream负载均衡模块

sayyy2024-01-14 11:53

前言

  • upstream 与 proxy 搭配使用

配置upstream

复制代码
upstream server_www.xxx.com_backend {
    server 192.168.1.128:8081 weight=1;
    server 192.168.1.128:8082 weight=2;
}

配置 server

复制代码
server {
    listen       80;
    server_name www.xxx.com;
    ...
    location / {
        proxy_pass http://server_www.xxx.com_backend;
        ...
    }
    ...
}

upstream说明

  • 有一个可用就行
上一篇:tim实践系列——消息特点与如何在实际业务中使用
下一篇:Java利用Apache compress包实现文件夹压缩成Zip包
相关推荐
FenceRain
19 小时前
Nginx 升级,平滑升级不停服务
服务器·网络·nginx
武器大师72
1 天前
实战踩坑:Gerrit HTTP 克隆失败解决方案
运维·nginx·gerrit
Plastic garden
1 天前
Docker Compose 的 RuoYi nginx exporter Prometheus + Alertmanager + 钉钉告警
nginx·docker·prometheus
一个儒雅随和的男子
1 天前
Nginx底层原理介绍
运维·nginx
小悟空
1 天前
[AI 生成] Nginx 502 Bad Gateway 排查手册(Python 后端篇)
python·nginx·gateway
Anthony_231
1 天前
Linux 从基础操作到故障排查
linux·运维·服务器·网络·nginx·ubuntu·centos
唐装鼠
2 天前
Nginx + Gunicorn + Python Web 应用 架构(Claude)
python·nginx·gunicorn
難釋懷
2 天前
Nginx扩容
运维·nginx
章老师说
2 天前
B站网关事故背后:OpenResty 与 Lua 的稳定性代价
nginx·云原生·负载均衡·lua·openresty
難釋懷
3 天前
Nginx-CA 签名
服务器·nginx·ssl
热门推荐
01GitHub 镜像站点022026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf03【AI】2026 年具身智能模型和世界模型总结04Codex 下载安装指南:Windows 和 macOS 官方版下载05Codex 桌面端更新后 Chrome 插件和 Computer Use 不可用,怎么排查和修复06【踩坑记录 | 第一篇】微软商店无法使用时,如何手动安装 OpenAI Codex?附`.msix`文件系统错误解决方法07CC-Switch 下载、安装与使用配置指南【2026.5.29】08Codex 接入 DeepSeek API 完整配置文档09CC-Switch & Claude 基于 Linux 服务器安装使用指南10裂开!ChatGPT 居然开始要手机号验证,附详细解决方法