I was setting up my DO ubuntu 20 server with Django, then I ran python manage.py runserver 0.0.0.0:8000, just to test if everything was going well. But I noticed that some bad requests were being requested by some very rare domains, and the worst is that they were asking to add them to the ALLOWED_HOST.
These are the bad and rare requests:
Invalid HTTP_HOST header: ‘m8.tehran.monster’. You may need to add ‘m8.tehran.monster’ to ALLOWED_HOSTS. Bad Request: /
Then, I changed my settings.DEBUG to False, set a new secret_key and put the server into action again (python manage.py runserver…). This time these were the requests the server received:
[09/Jul/2020 17:23:24] “GET / HTTP/1.1” 400 143 [09/Jul/2020 17:26:12] “GET / HTTP/1.1” 400 143
Could anyone explain to me what was happening?
Thank you very much
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!
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!