End.

K8S配置获取真实ip(阿里云)

阿里云配置项:

kube-system/nginx-configuration

或者用命令:

kubectl -n kube-system edit cm nginx-configuration

添加以下内容即可

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