I have a traefik instance which is configured to serve a domain and automatically manage the certificate using letsencrypt. This is working fine for the domain but if a user tries the IP directly they see a 404 and the default cert.
I've tried adding the following (where IP is the external IP the domain resolves to) but it doesn't work:
In general this Host(`app.domain.com`) || Host(`1.2.3.4`) should work (without TLS).
But you can't really use TLS with an IP, it will usually create an error on client side.
Also note hat you assign TLS to the router, which uses web and websecure entrypoints, so you enable TLS on port 80. Rather place TLS on the entrypoint directly.
Thanks, I've separated the two routes but still using tls on the router as per the documentation. Not entirely sure what you were trying to show through that link, can you put an example?
You can define a ACME Default Certificate (doc). If you only set existing domain app.domain.com and no sans, it should run with your existing setup. If you go sans wildcard, you need dnsChallenge.