- 问题:
在K8S上部署应用时候,会发现从POD里边获取的IP一直都是F5的IP,思虑良久,怀疑是Ingres端那边被丢弃了类似X-FORWARD-FOR的信息,于是就有了下面的解决方案。 - 解决方案:
Rancher上配置界面如下,在项目:System,命名空间ingress-nginx,配置映射: nginx-configuration中增加键值对即可。- 参数说明:
(1)compute-full-forwarded-for
Append the remote address to the X-Forwarded-For header instead of replacing it. When this option is enabled, the upstream application is responsible for extracting the client IP based on its own list of trusted proxies.
(2)forwarded-for-header
Sets the header field for identifying the originating IP address of a client. default: X-Forwarded-For
(3)use-forwarded-headers
- 参数说明:
- If true, NGINX passes the incoming X-Forwarded-* hea
版权声明:本文为fairytalefu217原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。