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;
        }
相关推荐
牧以南歌〆2 小时前
在Ubuntu主机中修改ARM Linux开发板的根文件系统
linux·arm开发·驱动开发·ubuntu
夜月yeyue3 小时前
设计模式分析
linux·c++·stm32·单片机·嵌入式硬件
kfepiza3 小时前
Debian的`/etc/network/interfaces`的`allow-hotplug`和`auto`对比讲解 笔记250704
linux·服务器·网络·笔记·debian
cuijiecheng20184 小时前
Ubuntu下布署mediasoup-demo
linux·运维·ubuntu
群联云防护小杜5 小时前
构建分布式高防架构实现业务零中断
前端·网络·分布式·tcp/ip·安全·游戏·架构
独行soc6 小时前
2025年渗透测试面试题总结-2025年HW(护网面试) 33(题目+回答)
linux·科技·安全·网络安全·面试·职场和发展·护网
java龙王*6 小时前
开放端口,开通数据库连接权限,无法连接远程数据库 解决方案
linux
bcbobo21cn7 小时前
Linux命令的命令历史
linux·histsize·histfile
岸边的风8 小时前
无需公网IP的文件交互:FileCodeBox容器化部署技术解析
网络·网络协议·tcp/ip
jingyu飞鸟8 小时前
linux系统源代码安装apache、编译隐藏版本号
linux·运维·apache