About Avoiding Error Reports Referring to Wrong Domains
When an unknown domain is assigned to your server's IP address and it is accessed in a browser, Django raises and error about the domain name not being in ALLOWED_HOSTS
.
To catch all unknown domains, before accessing the Django project, put this at the beginning of your nginx domain configuration:
server {
listen 80 default_server;
listen 443 ssl default_server;
server_name _;
include /etc/nginx/snippets/snakeoil.conf;
return 444;
}
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You