New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
providers.docker.defaultrule #10509
Comments
Hello @WPF0414 , Thanks for your interest in Traefik. The error you've encountered is due to the file provider interpreting Feel free to leave a new comment if you continue to experience any issues. |
@lbenguigui thanks!How do I deal with it? I'm currently using lable:traefik. http. routers. xxx. Rule is processed in the form of providers. Docker. defaultrule deleted, but I could have used it in the command in docker-compose before. |
Hello @WPF0414 , If you want to split static & dynamic configuration that coming from your file provider, I suggest you to replace : ...
providers:
providersThrottleDuration: 2s
docker:
watch: true
network: traefik
defaultrule: Host(`{{ .ContainerName }}.xxxx.com`)
endpoint: unix:///var/run/docker.sock
file:
watch: true
directory: /etc/traefik
... by : ...
providers:
providersThrottleDuration: 2s
docker:
watch: true
network: traefik
defaultrule: Host(`{{ .ContainerName }}.xxxx.com`)
endpoint: unix:///var/run/docker.sock
file:
watch: true
filename: /etc/traefik/my_dedicated_file.yaml #or directory: /etc/traefik/my_dedicated_directory
... And set all the dynamic configuration related to the file provider in the dedicated file (or directory). |
I have used the docker label to solve this problem, thank you very much! |
Welcome!
What did you do?
1.unraid install traefik
2.add the traefik.yml and fileconfig.traefik
3.update the
providers.docker.defaultrule
What did you see instead?
If the
defaultrule
(defaultrule: Host({{ .ContainerName }}.xxxx.com)
) is set, the startup prompts{"level":"error","msg":"Error occurred during watcher callback: /etc/traefik/traefik.yml: template: :68:26: executing "" at \u003c.ContainerName\u003e: can't evaluate field ContainerName in type bool","providerName":"file","time":"2024-03-10T01:10:38-08:00"}
, and the proxy is correct for ContainerName+domain but the configuration in fileconfig does not take effect. If thedefaultrule
(defaultrule: Host({{ .ContainerName }}.xxxx.com)
) is removed, fileconfig becomes effective, and the proxy container becomes the container name.config is not in effect at this time
But when I restarted, he was wrong again.This is what I want when I enter the container's delete defaultrule:
Host('{{. ContainerName }}. xxxx. com ")
What version of Traefik are you using?
v2.11.0
What is your environment & configuration?
Add more configuration information here.
If applicable, please paste the log output in DEBUG level
The text was updated successfully, but these errors were encountered: