Skip to content

Instantly share code, notes, and snippets.

@red8888
Created April 22, 2019 19:51
Show Gist options
  • Save red8888/7b18f091b1355a813e3ca2f474721c90 to your computer and use it in GitHub Desktop.
Save red8888/7b18f091b1355a813e3ca2f474721c90 to your computer and use it in GitHub Desktop.
add x-forwarded-for field
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: sdfsdfdsf
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.com/health-checks: "true"
nginx.com/health-checks-mandatory: "true"
nginx.com/health-checks-mandatory-queue: "100"
nginx.ingress.kubernetes.io/proxy-body-size: 50m
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
nginx.ingress.kubernetes.io/use-forwarded-headers: "true"
data:
log-format-upstream: >
'{{ if $cfg.useProxyProtocol }}$proxy_protocol_addr{{ else }}$remote_addr{{ end }} - '
'[$the_real_ip] - $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 $req_id '
'$http_x_forwarded_for'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment