Django + Nginx configuration why gives hell when it is indexed by search engines?

Hello, having a strange problem. The server is a dozen of sites on Django on the demons gunicorn'a + Nginx
The problem is that after placing a new site, he began to indexed under addresses other projects. For example.
New website on the server has a domain name www.1.ru and the title is "Site 1"
In the search engine you receive the results of such content
www.2.ru Website 1
www.3.ru Website 1
When you click on these addresses crashes 404
Nginx Configuration
server {
 server_name www.domain.ru domain.ru;

 location = /favicon.ico { access_log off; log_not_found off; }
 location /static/ {
 root /home/domain/domain/;
}

 location / {
 include proxy_params;
 proxy_pass http://unix:/home/domain/domain/domain.sock;
}

 gzip on;
 "gzip_disable" "msie6";
 gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript.



 listen 443 ssl; # managed by Certbot
 ssl_certificate /etc/letsencrypt/live/domain.EN/fullchain.pem; # managed by Certbot
 ssl_certificate_key /etc/letsencrypt/live/domain.EN/privkey.pem; # managed by Certbot
 include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
 if ($host = domain.ru) {
 return 301 https://$host$request_uri;
 } # managed by Certbot

 if ($host = www.domain.ru) {
 return 301 https://domain.ru;
}
 server_name www.domain.ru domain.ru;
 listen 80;
 return 404; # managed by Certbot
}

Tell me, please, what could be the problem?
Found that in the setting of a project ALLOWED_HOSTS was empty, but I doubt that it could affect such results
June 3rd 19 at 20:25
1 answer
June 3rd 19 at 20:27
Solution
add default server for nginx-but with a plug, then all requests will go to him.
https://nginx.ru/ru/docs/http/request_processing.html
server {
 listen 80 default_server;
 server_name example.net www.example.net;
...
}

Without this, all requests go to the first specified server for a given ip/port, and this is django.
Plus the Jangi was off checking the correctness of the header (ALLOWED_HOSTS is empty).
I recommend to configure on nginx, it's much cheaper in resources.
To disable ALLOWED_HOSTS not - marilyne_Roh commented on June 3rd 19 at 20:30

Find more questions by tags DjangoNginx