linux-nginx 通过F5负载、获取F5转发前的用户客户端真实ip

背景

客户通过F5提供的虚拟ip访问应用,应用通过nginx访问应用资源和转发请求

需要获取到客户的客户端真实地址

nginx安装http_realip_module模块

编译nginx时安装http_realip_module模块
./configure --prefix=/usr/local/nginx --with-http_realip_module

增加配置

修改后的配置

复制代码
        location ^~ /ttt/ {
            set_real_ip_from <F5地址>;--增加
            real_ip_header X-Forwarded-For;--增加
            real_ip_recursive on;--增加
            proxy_pass http://ttt_server;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-For $remote_addr;
            rewrite ^/ttt/(.*)$ /ttt/$1 break;
        }
相关推荐
Johny_Zhao13 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
blasit21 小时前
笔记:Qt C++建立子线程做一个socket TCP常连接通信
c++·qt·tcp/ip
闲云一鹤2 天前
nginx 快速入门教程 - 写给前端的你
前端·nginx·前端工程化
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
深紫色的三北六号2 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash3 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行4 天前
Linux和window共享文件夹
linux