posts - 252,comments - 20,views - 25万

背景

业务架构:client --> nginx --> ingress nginx controller --> svc --> pod

nginx中获取真实IP的配置

参考链接:https://developer.aliyun.com/article/70565

容器中获取真实IP的配置

修改容器ingress-nginx-controller的configmap
data下增加3行内容

compute-full-forwarded-for: "true"
forwarded-for-header: "X-Forwarded-For"
use-forwarded-headers: "true"

更多参数参考链接:https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/?spm=a2c6h.12873639.article-detail.6.122b7e88zXShVy#compute-full-forwarded-for

posted on   jiayou111  阅读(580)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

点击右上角即可分享
微信分享提示