Traefik global redirect from IP

Hi there!
I have been wanting to make Traefik redirect on access to domain name, if accessed via IP. Is it possible?
I have some apps, and local clients, that can access Traefik server via its IP, let's say 192.168.1.1. (Ideally it would also redirect from public IP)
I would love to set Traefik that way, so it redirects to example.com, as currently it will deny access because I have set sniStrict: true.
Could someone please share a config sample how to apply it globally? I'd appreciate it greatly. Thank you.

This only works when you use a Traefik http router, not plain TCP/IP.

You can create a router matching your IP, then use RedirectRegex middleware.

Alternatively you can use a redirect Docker service/container behind Traefik, like this one.