【发布时间】:2021-06-02 23:56:01
【问题描述】:
在 Openshift 4.6 中,我部署了一个公开 nginx 服务的应用程序。使用http 时,我可以在nginx 日志中看到$http_x_forwarded_for 字段的IP。每当我切换到https 时,$http_x_forwarded_for 标头就会丢失(-)。
http的路由配置:
spec:
host: <my.host.com>
to:
kind: Service
name: my-nginx
weight: 100
port:
targetPort: 80-tcp
wildcardPolicy: None
https的路由配置:
spec:
host: <my.host.com>
to:
kind: Service
name: my-nginx
weight: 100
port:
targetPort: 443-tcp
tls:
termination: passthrough
wildcardPolicy: None
有没有办法可以保留 https 请求的 http 标头?
【问题讨论】:
标签: nginx http-headers openshift