Wrong IP address to NginX/PHP


I've installed Traefik on Kubernetes ( OVH services ) with the Helm Chart and this TOML configuration.
My NginX/PHP application don't receive the real IP address ( REMOTE_ADDRESS, X-REAL-IP / X-FORWARDED-FOR ).
I've read I need to put passHostHeader = true somewhere but I don't know in which section, I've tried multiple position in the TOML without success. Any idea please?

apiVersion: v1
  traefik.toml: |
    # traefik.toml
    logLevel = "INFO"
    defaultEntryPoints = ["http","https"]
    passHostHeader = true
      address = ":80"
      compress = true
      passHostHeader = true
          regex = "^http://(.*)"
          replacement = "https://$1"
      address = ":443"
      compress = true
          CertFile = "/ssl/tls.crt"
          KeyFile = "/ssl/tls.key"
      format = "json"
    email = "xxxxxxxxxxxxxxxl@gmail.com"
    storage = "/acme/acme.json"
    entryPoint = "https"
    onHostRule = true
kind: ConfigMap
  creationTimestamp: "2019-04-11T08:46:19Z"
    app: traefik
    chart: traefik-1.66.0
    heritage: Tiller
    release: traefik
  name: traefik
  namespace: kube-system

Hello @lakano,

If you are needing to preserve the source IP of your requests, you should look at this document:


The issue you are encountering is due to kubernetes networking, not Traefik.

Thanks @daniel.tomcej for your help !
So, I don't need at all to put « passHostHeader = true » in traefik.toml ?
It's only related to K8S ?

I've found my K8S provider ( OVH ) have a specific protocol:

This should help if I remove Traefik and directly use NginX.
I'll try to check with my provider if there is a solution to make it compatible with Traefik.