Do not serve if over direct IP

Hi there! I'm new to Traefik so I'm not exactly sure how I would achieve this. Basically, I'd like to block serving content if I'm connecting to my external IP instead of my hostname. Or just redirecting from my IP to my hostname. I'm running Traefik v2.5 with docker-compose