Exclude certain Host()-statements from letsencrypt certificate creation

Hi everyone,

I run traefik version 3.2.
I use traefik to manage my letsencrypt certificates. However, I have some routers configured for whoms Host() I don't want a certificate, e.g., for a testing container which runs in my local network.

I would like to exclude such hosts from the certificate creation process. Is there a way to configure that?

For traefik v1 I found the "onHostRule" option which would have disable automated host-gathering altogether. That would also work for me. I think, however, that that option has been removed on the transition to traefik v2.

Best practice is to assign the certResolver on entrypoint.

If you don’t want all target services to use it, then you need to move it to each router requiring it. Leave out the test one.

That is good. Thanks.

Motivated by our answer I removed the permanent redirect on entrypoint :80 to :443 level such that I can run now the local services over http. That way, the certResolver can stay with the :443 entry point.