nginxtraefikresponse-headers

Is it possible to overwrite "server name" response header in traefik?


I'm setting up a new server with Traefik (version 1.7.10) for load balancing different NGINX and PHP-FPM containers.

Currently visitors see in the response header that my containers using NGINX. Where can I globaly, for all containers, overwrite the server response header to something other (like "FunnyServer") ?

With HAProxy I have done this in the past and wondering how to do this with Traefik?

Here you see the response coming from HAProxy:

cache-control: no-store, no-cache, must-revalidate, post-check=0, 
pre-check=0
content-type: text/html; charset=utf-8
date: Wed, 17 Apr 2019 20:20:15 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
pragma: no-cache
server: MonkeysBananaServer    <===== WITH HAPROXY!!! Traefik??? 
set-cookie: PHPSESSID=1234567890abcdef; path=/; domain=.xxx.xx
status: 200
x-powered-by: PHP/x.x.x

As you can see, under HAProxy I have set the response header to "MonkeysBananaServer".


Solution

  • You can override the response headers:

    traefik.frontend.headers.customResponseHeaders=server:FunnyServer
    

    https://docs.traefik.io/v1.7/configuration/backends/docker/#custom-headers