Hi, I'd like to ask for some help with using the error middleware with Traefik 3.7.5 on Docker. I'm getting an error which looks unrelated and I'm not sure if it's a configuration issue or a bug.
I'm trying to create an error middleware rewriting 403 to 500 but always get an unrelated error the service "@provider" does not exist when using it.
The errors middleware requires a service field, not just statusRewrites. That empty service is why Traefik com@providerlains about "@provider" not existing, it's trying to resolve a blank service name against the provider. The errors middleware needs to point at a backend service that serves your custom error page. Add a service key pointing to a defined service and the resolution error should clear.
There's one thing that is puzzling me though: Traefik can already display errors, so why does it need another service to display them here? My goal is to only change the http status code in certain circumstances, not display fancy error pages so if possible, I'd like to avoid adding another service.
After further research on the topic it seems that there is a plugin for this and that describe my use case.
"Some apps become unhappy when they receive unexpected error codes, such as when Traefik can't find an available server.
This plugin solves this issue by filtering and replacing problematic error codes with ones the app won't complain about."