I'm trying to redirect https://www.domain.com to https://domain.com but I have an issue. When I curl https://www.domain.com , I get a HSTS error and i'm not redirected. Basically my browser (curl) wants to approve the SSL certificate first I think, and it's failing, that's why chrome shows an HSTS issue.
This is my router, i tried removing the tls: option too
I'm sure that curl does not care for HSTS, it will be a certificate error because it will be using the self-signed traefik default certificate.
Chrome will show the HSTS error for the same reason. It is an HSTS error (vs a plain certificate error) because this site has presented an HSTS at some point in the past or it is an HSTS site compiled into the browser.
You have no definitive host in the rule for le to resolve a certificate to.
You can either make your rule a Host rule Host(`www.domain.com`)
Or add more tls options to your router:
tls:
certResolver: le
domains:
- main: "domain.com"
sans:
- "www.domain.com"