How to i see all the X-Forwarded-* response headers from traefik in browser?

I will like to be able to see all the X-Forwarded-* response headers in web browser when viewing the apps and allow these only via whitelisted ips addresses only

Is this possible with traefik?

If not then i will like to get the values of these X-Forwarded-* response headers and put them into the custom forwarded headers using the middleware

Hi @decypher_the_world,
Thanks for your interest in Traefik.

The X-Forwarded-* are set by Traefik while forwarding the request to your application.
Traefik does not provide such headers in the response to the user. In order for you to have this
information, your backend has to set itself a header with the received header value in the response.


so no way to pass those headers from traefik to the backend services/apps?

how do i get the value of the X-Real-Ip and X-Forwarded-Server headers to use for example?

Pretty much any way to get how traefik get the values for the headers? so one can just copy those commands to get them again from other services/apps

Hi @decypher_the_world,

Well, I think I don't really get what you are trying to achieve.
There are the options available related to X-Forwarded headers and IP whitelist.

  • entryPoints.forwardedHeaders: In a chain of proxy, traefik looks the X-Forwarded header and forward them to the next application. In this scenario, your application will receive the IP of the client behind one or more proxy.

  • IP Whitelist HTTP middleware: This middleware looks at the X-Forwarded-For header in the request, and only forward the request if the client IP is in the range defined in the middleware. With this middleware, you can restrict some content to specific IPs (e.g.: dashboard, admin panel...).

  • Custom application usage: Traefik will forward/create HTTP X-Forwarded-* headers and forward them to your application backend. The application can find them in the request and do custom logic with those values.

In all of these usages, the front-end / client does not have access to the X-Forwarded-* headers in the HTTP response, unless your custom logic in your application creates a Client-IP header with based on the X-Forwarded-For value.

If none of these tool helps you. Could you please describe a bit more your use case?


What i want is find out what command traefik is using to get the values for X-Forwarded-* so i can use these commands to generate the values again and display them with the forwarded headers middleware

My goal is to display these values in the frontend application in the browser for whitelisted ips only

i think i am very direct with what am asking; is English your primary language?