Forward all headers to backend

I use Traefik in a Docker container for my application.

I have a problem, that one particular header (in my case Wes_uid) is not forwarded to the backend application. I have no idea why. All other headers are being forwarded.

I see that the request contains the headers:

time="2019-10-02T06:35:58Z" level=debug msg="vulcand/oxy/roundrobin/rr: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/x/y/z/profil\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\"],\"Accept-Language\":[\"de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4\"],\"Cache-Control\":[\"no-transform\"],\"Clientcorrelator\":[\"vas3e682TdFnq-J37n6l\"],\"Connection\":[\"Keep-Alive\"],\"Cookie\":[\"SLSLanguage=de\"],\"Date\":[\"Wed, 02 Oct 2019 06:36:08 GMT\"],\"Hsp-Listeneruri\":[\"https://www.x.y.z\"],\"Hsp_client_addr\":[\"1.1.1.1\"],\"Hsp_https_host\":[\"www.x.y.z:443\"],\"Https\":[\"on\"],\"Logincredentials\":[\"\"],\"Requestcorrelator\":[\"x\"],\"Sslcipher\":[\"ECDHE-RSA-AES256-SHA\"],\"Sslcipherkeysize\":[\"256\"],\"Sslprotocolversion\":[\"TLSv1.2\"],\"Sslsessionage\":[\"939\"],\"Sslsessionid\":[\"629ea75591aaa022f1685525fd3f0bab5dde5c707c22f6bf4f47f063d13372e9\"],\"Sslsessiontimeleft\":[\"2661\"],\"User-Agent\":[\"Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36\"],\"Via\":[\"HTTP/1.1 Secure Entry Server,1.1 GQAAAK8F6GM-\"],\"Wes\":[\"xyz$$\"],\"Wes-Strong-Authentication\":[\"false\"],\"Wes_uid\":[\"user@name.com\"],\"X-Archived-Client-Ip\":[\"x.x.x.x\"],\"X-Forwarded-Host\":[\"www.x.y.z\"],\"X-Global-Transaction-Id\":[\"260449745d944558063c9851\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"x.y.t\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"x.x.x.x:23531\",\"RequestURI\":\"/x/y/z/profil\",\"TLS\":null}"

But I don't see it on the backend. What I am doing wrong?

Best Regards
Frederik

It's almost impossible to tell without being able to reproduce it, but I'd wager this is not because of traefik, because I've never heard about traefik randomly dropping arbitrary headers.. If you can let me know how I can see the same effect as you, I might be able to help. I'm guessing it has something to do with how you observing this. The header might go via some other application after traefik, and that application may affect what is being observed.

Ok, thanks! So could I say that otherwise configured Traefik would always forward all headers to the backend application?

Ok, I found the Problem: Nginx was ignoring all HTTP headers with _.

The following Nginx directive solved the problem:

underscores_in_headers on

Thanks for you help!