Question

unknown traffic coming into my site

I have a server running, Django and Python and get this in my error and project log files: I see this in my error logfile on the site:

django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: ‘www.mexquotesheettechs.com’. You may need to add ‘www.mexquotesheettechs.com’ to ALLOWED_HOSTS. ERROR 2025-02-24 22:46:40,880 exception Invalid HTTP_HOST header: ‘www.crmyypoliticallawyer.org’. You may need to add ‘www.crmyypoliticallawyer.org’ to ALLOWED_HOSTS. Traceback (most recent call last): File “/home/ProjectData-Platform/venv/lib/python3.12/site-packages/django/core/handlers/exception.py”, line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File “/home/ProjectData-Platform/venv/lib/python3.12/site-packages/django/utils/deprecation.py”, line 133, in call response = self.process_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/home/ProjectData-Platform/venv/lib/python3.12/site-packages/django/middleware/common.py”, line 48, in process_request host = request.get_host() ^^^^^^^^^^^^^^^^^^ File “/home/ProjectData-Platform/venv/lib/python3.12/site-packages/django/http/request.py”, line 151, in get_host raise DisallowedHost(msg) django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: ‘www.crmyypoliticallawyer.org’. You may need to add ‘www.crmyypoliticallawyer.org’ to ALLOWED_HOSTS.

all different site traffic which generate this in my project log file:

File “/home/ProjectData-Platform/venv/lib/python3.12/site-packages/django/http/request.py”, line 151, in get_host raise DisallowedHost(msg) django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: ‘www.crmyypoliticallawyer.org’. You may need to add ‘www.crmyypoliticallawyer.org’ to ALLOWED_HOSTS. WARNING 2025-02-24 22:46:42,664 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:46:43,498 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:01,322 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:05,862 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:13,879 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:37,210 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:38,660 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:39,339 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:49,013 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:49,346 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:57,944 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:58,393 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:47:59,377 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:01,132 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:02,768 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:03,514 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:12,648 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:19,114 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:20,258 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:28,794 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:29,940 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:31,562 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:34,211 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:39,642 log Forbidden (Referer checking failed - no Referer.): / WARNING 2025-02-24 22:48:42,256 log Forbidden (Referer checking failed - no Referer.): /

I only show a few here but there are a lot. Have anybody seen this and what can I do about it. I interferes with my download of data I do from another server. I get interal server errors, whilst with smaller download no problem ad on my development server, where I don’t have this traffic also no problem


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
February 25, 2025

Heya,

Your logs indicate that your Django server is receiving traffic from domains that are not explicitly listed in ALLOWED_HOSTS, triggering django.core.exceptions.DisallowedHost. Additionally, the Forbidden (Referer checking failed - no Referer.) errors suggest bot traffic or automated scanners trying to access your site.

Why This Happens

  1. Malicious or Random Bot Traffic: Your server is being hit by requests with various HTTP_HOST headers that do not match your configured domains.
  2. Misconfigured Proxy or Load Balancer: If your proxy or load balancer modifies the Host header incorrectly, Django may reject it.
  3. Web Scrapers or Automated Attacks: Attackers may be scanning for vulnerabilities by sending random Host headers.

You can specify the allowed_hosts in your django settings.py.

Also, there isn’t much to do about it but to block them using your firewall.

alexdo
Site Moderator
Site Moderator badge
February 26, 2025

Heya,

The traffic may comes from web-crawlers and also bot traffic from search engines. You can tweak the firewall settings and block the bots or the IP addresses if you believe this traffic is malicious and potential security risk.

Regards

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.