goodrain / rainbond

No need to know Kubernetes' cloud native application management platform | 不用懂 Kubernetes 的云原生应用管理平台
https://www.rainbond.com
GNU Lesser General Public License v3.0
4.96k stars 783 forks source link

关于网关配置X-Forwarded-For获取真实IP问题 #1947

Closed anhao closed 3 months ago

anhao commented 3 months ago

默认配置 https://github.com/goodrain/rainbond/blob/8a3186c9b57cf0fbabbcbe3b7bca09695fd06c80/gateway/controller/config/config.go#L108

"X-Forwarded-For":   "$remote_addr"

默认为 $remote_addr ,这样如果上层配置了CDN,会获取不到真实IP , 需要改成 $proxy_add_x_forwarded_for;

临时解决方案是 在网关策略里手动配置请求头

ZhangSetSail commented 3 months ago

是否有兴趣参与贡献一下呐。

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Are you interested in participating and contributing?