Tente alterar o bloco server_name em cada vhost
server {
...
server_name example.com *.example.com;
...
}
ou, conforme recomendado pelo nginx
server {
listen 80;
server_name *.example.com;
return 301 http://example.com$request_uri;
}
server {
listen 80;
server_name example.com;
...
your config removing the if part
...
}