0

I've been seraching the forums and also tried what most answers advised to.

Error Msg:

DisallowedHost at / Invalid HTTP_HOST header: 'theile-albrecht.de'. You may need to add u'theile-albrecht.de' to ALLOWED_HOSTS. Request Method: GET Request URL: http://theile-albrecht.de/ Django Version: 1.11.15 Exception Type: DisallowedHost Exception Value:
Invalid HTTP_HOST header: 'theile-albrecht.de'. You may need to add u'theile-albrecht.de' to ALLOWED_HOSTS. Exception Location: /usr/local/lib/python2.7/dist-packages/django/http/request.py in get_host, line 113 Python Executable: /usr/bin/python Python Version: 2.7.12 Python Path:
['/home/django/django_project', '/home/django/django_project', '/usr/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] Server time: Sat, 4 Aug 2018 08:33:11 +0000

That's what I did:

ALLOWED_HOSTS = ['theile-albrecht.de']

I also tried:

ALLOWED_HOSTS = ['*'] aswell as localhost

After each try I restarted the server but didnt work

Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
  • I suggest you run your `django-admin shell` and chech if `django.conf.settings.ALLOWED_HOSTS` is what you've set. – vishes_shell Aug 04 '18 at 10:05
  • Have you set `proxy_set_header Host $host` in your nginx config? – Madhan Varadhodiyil Aug 04 '18 at 10:15
  • Not sure what that means, i'm not that deep into it. Website was running for 7 Months straight, but after i tried to reface letsencrypt for the second time this error came up. All it did is: ./letsencrypt-auto certonly --standalone -d theile-albrecht.de Maybe i did something wrong? – Theile Albrecht Aug 04 '18 at 11:28
  • @TheileAlbrecht You've to add `Host` header in your nginx config. [thins might help you to set it up](https://stackoverflow.com/questions/21970750/error-invalid-http-host-header-webapps-gunicorn-sock). Or can you us the relevant nginx.conf please? – Madhan Varadhodiyil Aug 04 '18 at 12:56
  • @MadhanVaradhodiyil https://textuploader.com/dzby9 – Theile Albrecht Aug 04 '18 at 13:51

0 Answers0