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 天前
linux 配置环境变量
linux
傲世仙尊2 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
还是大剑师兰特2 天前
解决nginx错误:http://localhost:7000正常,http://localhost:7000/map 报错404
nginx·大剑师
_艾伦 耶格尔.2 天前
进程间通信
linux
Liuqy-052 天前
Linux IO编程——静态库、动态库
linux
彧azz2 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
xing-xing2 天前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
-梅2 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK2 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖2 天前
SimlpeHttp
linux·服务器