A little modification.
server {
port_in_redirect off;
server_tokens off;
if ($http_host$request_uri = 'example-xyz.com') {
return 403;
break;
}
listen 80;
}
server {
port_in_redirect off;
server_tokens off;
if ($http_host$request_uri = 'example-xyz.com') {
return 403;
break;
}
listen 80;
}