Does Traefik support dropping requests that lack a Host header (direct IP access)?

Hi everyone,

I’m looking to configure Traefik to **drop/reject** any incoming HTTP/HTTPS request that does **not** include a valid `Host` header i.e., requests hitting the server directly via its public IP without a domain.

Use case: Prevent direct IP access and force all traffic through proper virtual hosts.

Questions:

  1. Is there a built-in way (middleware, entrypoint config, etc.) to **drop** such requests (e.g. return 444, 400, or just close the connection)?
  2. If not natively, can this be achieved with a custom middleware (e.g. plugin) or by combining existing ones?
  3. Any recommended configuration snippet for Traefik v3?

I’ve seen `entryPoints` and `serversTransport`, but nothing specifically for mandatory Host headers.

Thanks in advance!

There is a big difference between "dropping a connection" and responding with a HTTP status code.

When you access your Traefik server with an unknown domain or just IP, it will return a HTTP status 404 anyway.

Maybe check simple Traefik example.