Host filtering restricts accepted hostnames so untrusted host values cannot influence generated URLs or request handling. It becomes especially important when an ASP.NET Core application exposes Kestrel directly without a reverse proxy. section 27.4
Apply the practice according to the hosting arrangement:
- Use host filtering when manually configuring the listening URL, exposing Kestrel to clients, or deploying behind infrastructure such as NGINX. section 27.4
- Treat IIS reverse-proxy integration differently: IIS handles URL integration, so this specific manual URL setup is not required. section 27.4
