I have a server that is using Nginx's 444 to drop connections to undefined hosts:
server {
listen 80;
server_name "";
return 444;
}
But I can't figure out how to test if it's working.
Here are a few things I've tried, stabbing in the dark:
$ curl -I mysite.com --header 'Host: ""'
HTTP/1.1 301 Moved Permanently
$ curl -I mysite.com --header ''
HTTP/1.1 301 Moved Permanently
I'm trying to get that 444!
Here's the relevant portion of my nginx mysite.conf file
server {
listen 80;
server_name "";
return 444;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
So either I'm testing it wrong, or I'm testing it correctly but the missing host header is still getting captured by my second server block and redirecting.