Upgrade Traefik 3.7 to 3.8 with Docker: the aliasHeadersStrategy is not configured warning and the 431 error
Table of contents
- Key takeaways
- What changes between Traefik 3.7 and 3.8 on a Docker install
- How I tested it
- Step 1: pin the tag and switch the image to v3.8.0
- What "aliasHeadersStrategy is not configured" means
- Why you do not see the warning at the default log level
- Spoofing test: X_Auth_User against a PHP backend
- How to clear the warning: global.aliasHeadersStrategy or per entry point
- "431 Request Header Fields Too Large" error after upgrading
- How to raise the limit with maxHeaderValueCount
- Gotchas I ran into
- FAQ
- Should I pick delete or reject for aliasHeadersStrategy?
- Do I avoid the warning and the 431 if I stay on Traefik 3.7?
- Can I set aliasHeadersStrategy in container labels?
- Conclusion
- Sources
When you upgrade Traefik 3.7 to 3.8 with Docker, the aliasHeadersStrategy is not configured warning is logged once per entry point and goes away with global.aliasHeadersStrategy set to delete. The 431 Request Header Fields Too Large answer comes when a request carries more than 500 header values, and maxHeaderValueCount on the entry point changes that limit.
When you upgrade Traefik 3.7 to 3.8 with Docker, the aliasHeadersStrategy is not configured warning is logged once per entry point and goes away with --global.aliasHeadersStrategy=delete. The 431 Request Header Fields Too Large answer comes when a request carries more than 500 header values, and maxHeaderValueCount changes that limit. Neither is new in 3.8.0: the warning arrived in 3.7.12 and the limit in 3.7.17, so you meet them on upgrade if you come from an older 3.7. I reproduced both on 25 November 2026 with six images, from 3.7.11 to 3.8.0, and this guide has the literal log line, the literal response and the tested fix. The same guide is available in Spanish.
Key takeaways
- The warning only shows with
log.levelatWARN,INFOorDEBUG. At the default level,ERROR, Traefik 3.8.0 starts without writing it and the unsafe configuration is still there. - Without the option, a client that sends
X_Auth_User: adminoverrides theX-Auth-User: alicethat Traefik sets: in my test, PHP 8.4.28 readadmin. --global.aliasHeadersStrategy=deleteclears the warning on every entry point with one line. It exists since 3.7.17; on 3.7.16 and earlier Traefik does not start with it.- The limit is 500 header values per request: 500 lines get a 200 and 501 lines get a 431. Over HTTP/2 every cookie sent in its own field counts as one value.
- The request rejected with 431 is not in the access log, nor in the log at
DEBUGlevel. Only the client sees it.
What changes between Traefik 3.7 and 3.8 on a Docker install
For Traefik on Docker, what you notice when moving to 3.8 arrived spread over 3.7 patch releases. 3.8.0 was published on GitHub on 23 November 2026, the same day as 3.7.20. The rest of the Traefik v3 migration guide[1] for 3.8 is almost entirely about the Kubernetes Gateway API provider. This table sums up what affects a Compose file and the release where it appeared:
| Change | Since | What you notice |
|---|---|---|
aliasHeadersStrategy is not configured warning |
3.7.12 | One WRN line per entry point at startup |
Upgrade: h2c no longer forwarded |
3.7.13 | The backend serves those requests over HTTP/1.1 |
Rootless targets (http:example.com/admin) |
3.7.13 | 400 Bad Request |
CONNECT rejected on every HTTP version |
3.7.15 | 501 Not Implemented |
| Limit of 500 header values (Go 1.27) | 3.7.17 | 431 Request Header Fields Too Large |
global.aliasHeadersStrategy |
3.7.17 | One default for every entry point |
| BasicAuth passwords over 1,024 bytes | 3.7.18 and 3.8.0 | 401 Unauthorized, not configurable |
Host with a double wildcard (**.example.com) |
3.8.0 | New feature; ACME issues no certificate for that domain |
I checked the releases for the warning and the limit against the images. 3.7.11 starts without the warning and 3.7.12 writes it. 3.7.16 accepts 501 header lines and 3.7.17 rejects them.
I tested CONNECT on 3.8.0 and it answered 501 Not Implemented. The rows on h2c, rootless targets, BasicAuth and the double wildcard come from the migration guide and I have not tested them.
How I tested it
I set up a Compose project with Traefik, the Docker provider and two backends. One is traefik/whoami 1.11.0, which returns the headers it receives. The other is the built-in web server of PHP 8.4.28, printing $_SERVER['HTTP_X_AUTH_USER'].
I used the ghcr.io/traefik/traefik images tagged v3.7.11, v3.7.12, v3.7.16, v3.7.17, v3.7.20 and v3.8.0, on Docker 29.5.2 and Docker Compose 2.40.3 on an arm64 Linux machine. traefik version reports that 3.7.16 is built with Go 1.26.10 and that 3.7.20 and 3.8.0 use Go 1.27.4.
I sent the requests with hundreds of headers with curl 8.14.1 and with a Python script that writes to the socket, to control the exact number of lines. For HTTP/2 I used curl --http2-prior-knowledge and the Python h2 library. The machine was shared and under load, so I publish no timings: only status codes, counts and log text.
Step 1: pin the tag and switch the image to v3.8.0
The upgrade is a tag change, and it pays to keep the version pinned in a .env file so that rolling back is one line. This is the Compose file from the test; in the lab I published ports 38010 and 38011 instead of 80 and 443:
services:
traefik:
image: ghcr.io/traefik/traefik:${TRAEFIK_TAG}
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml:ro
The .env file held TRAEFIK_TAG=v3.7.16. If you use the traefik image from Docker Hub, the v3.8.0 tag has been there since 24 November. On the same day latest, v3 and v3.8 moved to 3.8.0: on 30 November they share its digest and there is no 3.8.1 yet. If your Compose file uses traefik:latest or traefik:v3, your last docker compose pull already made this jump for you. Before you touch anything, copy acme.json if Traefik manages your certificates: my lab did not use ACME, so I have not tested that part. Then change the tag, pull the image and recreate Traefik only:
sed -i 's/^TRAEFIK_TAG=.*/TRAEFIK_TAG=v3.8.0/' .env
docker compose pull traefik
docker compose up -d traefik
docker compose exec traefik traefik version
docker compose logs traefik | \
grep -c 'aliasHeadersStrategy is not configured'
traefik version answered Version: 3.8.0, Codename: salers and Go version: go1.27.4. The grep returned 2, one for each entry point in my traefik.yml (web and websecure), and whoami kept answering 200. If you do not run Traefik yet, the guide to install Traefik with Docker Compose covers the install from scratch.
What "aliasHeadersStrategy is not configured" means
The warning says that this entry point forwards, unchanged, the headers whose name imitates another header's name, and that a backend can confuse them. This is the line from 3.8.0 with log.level=WARN; in the log it is a single line, wrapped here to fit:
2026-11-25T13:24:17Z WRN aliasHeadersStrategy is not configured: the
request headers whose name aliases another header name (e.g.
X_Auth_User or X.Auth.User for X-Auth-User) are forwarded as is. The
backends deriving variable names from the header names (CGI, WSGI,
PHP, NGINX, ...) read them as the header they alias, which allows a
client to spoof the headers Traefik manages. Please set it to delete
or reject on the entry points fronting such backends.
entryPointName=web
Traefik writes one line for each entry point that lacks the option, and only the entryPointName at the end changes. With --api.insecure=true, the internal traefik entry point on port 8080 produced no warning in my test. The text is identical on 3.7.12, 3.7.16, 3.7.17, 3.7.20 and 3.8.0.
The cause is how Traefik and the backends treat header names. Go, the language Traefik is written in, handles X-Auth-User, X_Auth_User and X.Auth.User as three different headers. Backends that follow the CGI (Common Gateway Interface) convention, such as PHP or Python WSGI applications, do something else. They uppercase the name and turn everything that is not a letter or a digit into _, so for them all three are the same HTTP_X_AUTH_USER variable.
The Traefik documentation counts 14 characters that build such an alias, among them _, ., !, ~ and +. Only the dash form is unambiguous.
Next to this warning you will see another one, Traefik can reject some encoded characters in the request path. It is not new: 3.7.11 already wrote it in my test, and it is about encoded characters in the path, not about headers.
Why you do not see the warning at the default log level
The warning has level WRN and Traefik's default level is ERROR, so an install without log.level never shows it. On my first pass I started 3.7.11, 3.7.16, 3.7.20 and 3.8.0 without that option, and the count was 0 on all four. With --log.level=WARN it appeared on 3.7.16, 3.7.20 and 3.8.0.
Not seeing it does not change the behaviour: aliasing headers are forwarded all the same. To find out whether you are affected without changing the configuration, start Traefik once with --log.level=WARN or send the test request from the next section.
Spoofing test: X_Auth_User against a PHP backend
With the option unset, a client replaces the value of a header that Traefik sets. To check it I added a headers middleware to the PHP router with customRequestHeaders.X-Auth-User=alice, which mimics what ForwardAuth does when an identity provider such as Authentik returns the authenticated user. Then I sent four requests:
$ curl -s http://localhost/php/
HTTP_X_AUTH_USER=alice
$ curl -s -H 'X_Auth_User: admin' http://localhost/php/
HTTP_X_AUTH_USER=admin
$ curl -s -H 'X.Auth.User: admin' http://localhost/php/
HTTP_X_AUTH_USER=admin
$ curl -s -H 'X-Auth-User: admin' http://localhost/php/
HTTP_X_AUTH_USER=alice
The middleware overwrites the dash form, which is why the fourth request returns alice. The _ and dot forms reach PHP next to the one from Traefik, and PHP keeps the client's. If your application trusts a user header set by the proxy, this is identity spoofing with a single header.
Not every backend is vulnerable. whoami, written in Go, showed X_auth_user and X.auth.user as separate headers. The nginx documentation[2] states that underscores_in_headers is off by default and that header names containing _ are treated as invalid. The risk is in PHP, WSGI or CGI backends that receive the request directly from Traefik.
How to clear the warning: global.aliasHeadersStrategy or per entry point
The shortest way is a global value, which applies to every entry point that does not set its own. The option takes three values: keep forwards, delete removes the aliasing header and reject answers 400. This is the traefik.yml I ended the test with:
global:
aliasHeadersStrategy: delete
log:
level: INFO
accessLog: {}
providers:
docker:
exposedByDefault: false
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
If you configure Traefik with arguments under command, the equivalent line is --global.aliasHeadersStrategy=delete. To decide per entry point, use --entryPoints.web.http.aliasHeadersStrategy=delete or the http.aliasHeadersStrategy key under each entry point in YAML; the entry point value wins over the global one. It is static configuration: it cannot go in container labels and it requires recreating Traefik.
After recreating the container, the grep -c from step 1 returned 0. This is what each value did on 3.8.0 with the X_Auth_User: admin request:
| Configuration | Response | PHP reads | Warning at startup |
|---|---|---|---|
| Not configured | 200 | admin |
Yes |
Explicit keep |
200 | admin |
No |
delete |
200 | alice |
No |
reject |
400 Bad Request | Never reaches the backend | No |
underscoreHeadersStrategy=delete |
200 | alice with _, admin with . |
Deprecation warning |
Look at the second row: an explicit keep silences the warning and leaves the spoofing intact. Use it only if no backend derives variables from header names.
delete and reject cannot tell a spoofing attempt from a legitimate header. With delete, whoami stopped receiving X_Request_Id: 42 and kept receiving X-Request-Id: 43. Before you enable it, check whether any of your applications uses headers with _ or a dot in the name. According to the Traefik documentation on headers with aliasing names[3], the IANA header registry contains none with those characters.
"431 Request Header Fields Too Large" error after upgrading
Since 3.7.17, Traefik rejects requests with more than 500 header values, because it is built with Go 1.27 and inherits its limit. The HTTP/1.1 response on 3.8.0 is this one, with a plain-text body:
HTTP/1.1 431 Request Header Fields Too Large
Content-Type: text/plain; charset=utf-8
Connection: close
431 Request Header Fields Too Large
Over HTTP/2 the code is the same and the body changes. If you search for the error by the text you see in the browser, it is this:
HTTP/2 431
content-type: text/html; charset=utf-8
content-length: 63
<h1>HTTP Error 431</h1><p>Request Header Field(s) Too Large</p>
The Traefik migration guide explains it this way: "Go 1.27 limits the number of header values a request can carry to 500." What counts is header lines, not bytes or the comma-separated values inside one line: the size limit, maxHeaderBytes, is still 1,048,576 bytes and is a different option. These are the requests I sent to 3.8.0:
| Request | Values counted | Response |
|---|---|---|
HTTP/1.1 with 500 header lines, Host included |
500 | 200 |
| HTTP/1.1 with 501 header lines | 501 | 431 |
| HTTP/1.1 with one line of 2,000 comma-separated values | 3 | 200 |
HTTP/1.1 with one Cookie header holding 600 cookies |
4 | 200 |
| HTTP/2 with 496 cookies, each in its own field | 500 | 200 |
| HTTP/2 with 497 cookies, each in its own field | 501 | 431 |
3.7.16, built with Go 1.26.10, accepted 2,002 header lines and the 600 cookies over HTTP/2 without complaint. Over HTTP/2 the four pseudo-headers (:method, :scheme, :authority and :path) count too, which is why the cut-off is at 496 cookies and not at 500.
The cookie case is the one that can reach an ordinary install. Section 8.2.3 of RFC 9113[4] lets an HTTP/2 client split the Cookie header into one field per cookie. Traefik counts every field, while the same 600 cookies on a single line pass. The other likely source is API clients or webhooks that repeat one header hundreds of times.
This 431 is not the Caddy one. In Caddy 2.11.6 the limit that changed is the total size of the headers, and I cover it in the guide to the Caddy 2.11 431 error. In Traefik the size has not changed; the count is what is new.
How to raise the limit with maxHeaderValueCount
The limit is changed per entry point with maxHeaderValueCount, which exists since 3.7.17 and defaults to 500. Add it only where you need it:
entryPoints:
websecure:
address: ":443"
http:
maxHeaderValueCount: 1000
As an argument it is --entryPoints.websecure.http.maxHeaderValueCount=1000. With that value, 3.8.0 accepted 1,000 header lines and answered 431 to the 1,001st. The entry point reference adds that the option applies to HTTP/1 and HTTP/2 and has no effect on HTTP/3; I have not tested that.
To confirm that the 431 comes from Traefik and not from the backend, repeat the request with curl, which adds Host, User-Agent and Accept to the 498 from the loop:
args=()
for i in $(seq 1 498); do args+=(-H "X-Test-$i: 1"); done
curl -s -o /dev/null -w '%{http_code}\n' \
"${args[@]}" http://localhost/
With 498 added headers it answered 431 and with 497, 200. Do not look for the rejected request on the server: the migration guide warns that "the rejected requests are not reported in the access logs". In my test the access log had 0 lines with 431, and with log.level=DEBUG no line about the rejection appeared either.
Gotchas I ran into
Four errors came up while testing combinations of the options. The first two stop Traefik from starting, and with restart: unless-stopped the container goes into a loop:
- Rolling back to an old 3.7 with the option in place: 3.7.11 with
aliasHeadersStrategyintraefik.ymlexits withcommand traefik error: field not found, node: aliasHeadersStrategy. With arguments the text isfailed to decode configuration from flags: field not found, node: aliasHeadersStrategy. 3.7.16 fails the same way with--global.aliasHeadersStrategyand withmaxHeaderValueCount. If you roll back, go to 3.7.20, which accepts all three options. - Both options with different values:
underscoreHeadersStrategy=deletenext toaliasHeadersStrategy=rejectends inentry point "web" cannot have both underscoreHeadersStrategy and aliasHeadersStrategy options configured with different values. - A mistyped value:
aliasHeadersStrategy=dropgivesentry point "web" has an invalid aliasHeadersStrategy value "drop". - The old option on its own:
underscoreHeadersStrategystill works, but it writesThe underscoreHeadersStrategy option is deprecated, please use the aliasHeadersStrategy option insteadand letsX.Auth.Userthrough.
If you also load plugins, check the Traefik plugin integrity check failed error, which appeared on the 3.7 branch and also disables middlewares at startup.
FAQ
Should I pick delete or reject for aliasHeadersStrategy?
Start with delete in a homelab: the request keeps working and the aliasing header never reaches the backend. reject answers 400 Bad Request to every request that carries a header with _, a dot or another of the 14 characters, and that breaks clients that send them out of habit. Use it when you prefer the client to see the failure.
Do I avoid the warning and the 431 if I stay on Traefik 3.7?
No, if you are on the latest one. 3.7.20, published the same day as 3.8.0, wrote the same warning and answered 431 to the same 501-line request in my test. Only releases before 3.7.12 do not warn, and those before 3.7.17 have no limit.
Can I set aliasHeadersStrategy in container labels?
No. It is a static configuration option, like maxHeaderValueCount: it goes in traefik.yml, in the command arguments or in Traefik environment variables, and it applies when the container is recreated. Docker labels only define routers, services and middlewares.
Conclusion
Upgrading Traefik 3.7 to 3.8 with Docker is a tag change, and what you see afterwards depends on which 3.7 you come from. Set log.level to WARN at least once to learn whether the warning is there, add global.aliasHeadersStrategy: delete and check with X_Auth_User that the backend no longer receives the alias. If a client gets a 431, count its headers and raise maxHeaderValueCount on that entry point only.
If you roll back, do not go below 3.7.20 with the new options in the file. The next change worth preparing for in Traefik is Let's Encrypt 45-day certificates and ACME profiles.
Sources: [1] Traefik v3 migration guide, sections v3.8.0, v3.7.17 and v3.7.12[1], [2] Traefik documentation, headers with aliasing names[3], [3] Traefik entry points reference, maxHeaderValueCount and aliasHeadersStrategy[5], [4] Traefik v3.8.0 on GitHub[6], [5] Traefik v3.7.17 on GitHub[7], [6] Go 1.27 release notes, Server.MaxHeaderValueCount[8], [7] nginx documentation, underscores_in_headers[2], [8] RFC 9113, section 8.2.3, compressing the Cookie header field[4], [9] RFC 6585, section 5, the 431 status code[9].
Sources
- Traefik v3 migration guide
- nginx documentation
- Traefik documentation on headers with aliasing names
- Section 8.2.3 of RFC 9113
- Traefik entry points reference, maxHeaderValueCount and aliasHeadersStrategy
- Traefik v3.8.0 on GitHub
- Traefik v3.7.17 on GitHub
- Go 1.27 release notes, Server.MaxHeaderValueCount
- RFC 6585, section 5, the 431 status code
Source code
Access all the source code for this post on GitHub.
View on GitHub