I have tried removing the default Nginx site and also simply modifying it to drop any request without a server name but the results are the same. It seems the forward from 80 to 443 kicks in first and then defaults to forwarding to the first website on the server.... Not what I want to happen I just want it to drop the connection whether it's on 80 or 443. Is there a WordOps method for doing this? If not, what's the best Nginx method for doing so? If I put anything in the default to listen on 443 I get Nginx errors because there's no certificate, even though it would be ideal for this to drop before that even happens.

The best solution I've come up with is adding the following if statement to the first site... but it feels a bit clunky and something I'll have to always remember to do.

if ( $http_host !~* example.com|www.example.com$ ) {
return 444;
}

Thanks!

Hosted by VirtuBox