How to disable empty host head?


(goodforever) #1

I found a domain(not mine) directing my caddy server ip , someone told me that I must close empty host head config. I have never setup empty host head in my Caddyfile , How can I disable empty host head ?


(Matt Holt) #2

If your Caddyfile starts like this, for example:

:80, :443

(only port specified, no hostnames), then it will serve that site for all Host names that come in, including empty ones. You simply have to specify a domain name that you want to serve and it will reject others for that site.


(goodforever) #3

There are no that setting in my Caddyflie


(Matthew Fay) #4

You’re good, then - Caddy will not serve a site unless the Host header matches the site label, so requests like that will receive “No such site”.