java修改x-forward-for_如何将x-forward-for字段添加到我的Nginx入口控...

您应该使用ConfigMap到customize the NGINX configuration:

07001 allow you to decouple configuration artifacts from image

content to keep containerized applications portable.

The ConfigMap API resource stores configuration data as key-value

pairs. The data provides the configurations for system components for

the nginx-controller.

例如.:

创建以下配置映射:

apiVersion: v1

data:

log-format-upstream: '$remote_addr - $request_id - [$proxy_add_x_forwarded_for] - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_length $request_time [$proxy_upstream_name] $upstream_addr $upstream_response_length $upstream_response_time $upstream_status'

kind: ConfigMap

metadata:

name: nginx-ingress-config

并确保您将–configmap = $(POD_NAMESPACE)/ nginx-ingress-config用作nginx-ingress-controller(example from offical repo here)的命令参数.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值