errors middleware: status syntax error
Welcome!
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've searched similar issues on the Traefik community forum and didn't find any.
What did you do?
The error middleware's statusRewrites option should support the same syntax as the status option, as stated in the documentation https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/errorpages/#statusrewrites
They should support numbers, comma separated numbers and dashes but these currently cause errors.
When using a comma, the routers using it crash. When using a dash, only the first status code is honored.
What did you see instead?
statusRewrites:
"403,404": 500
ERR error="strconv.Atoi: parsing \"403,404\": invalid syntax" entryPointName=websecure routerName=service@docker
statusRewrites:
"403-404": 500
Only the 403 errors are rewritten to 500. 404 errors stay 404.
What version of Traefik are you using?
Version: 3.7.13 Codename: langres Go version: go1.26.8 Built: 2026-09-04T12:31:42Z OS/Arch: linux/amd64
What is your environment & configuration?
http:
middlewares:
error-pages_rewrite:
errors:
status:
- "400-599"
statusRewrites:
"403-404": 500
service: error-pages-service@docker
query: /{status}
If applicable, please paste the log output in DEBUG level
No response
Source: traefik/traefik