Originally created by @hackdefendr on GitHub (Nov 8, 2025).
This is a brand new fresh installation and the only thing I did different was to put an Nginx reverse proxy in front of the app. DJANGO_ALLOWED_HOSTS is default, but it won't allow me to access and instead throws an HTTP 400 as shown below:
localhost | [2025-11-08 09:34:56] - ERROR - django.security.DisallowedHost - Invalid HTTP_HOST header: 'finance.knowelltech.net'. You may need to add 'finance.knowelltech.net' to ALLOWED_HOSTS.
localhost | Traceback (most recent call last):
localhost | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
localhost | response = get_response(request)
localhost | ^^^^^^^^^^^^^^^^^^^^^
localhost | File "/usr/local/lib/python3.11/site-packages/django/utils/deprecation.py", line 119, in __call__
localhost | response = self.process_request(request)
localhost | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
localhost | File "/usr/local/lib/python3.11/site-packages/django/middleware/common.py", line 48, in process_request
localhost | host = request.get_host()
localhost | ^^^^^^^^^^^^^^^^^^
localhost | File "/usr/local/lib/python3.11/site-packages/django/http/request.py", line 202, in get_host
localhost | raise DisallowedHost(msg)
localhost | django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'finance.knowelltech.net'. You may need to add 'finance.knowelltech.net' to ALLOWED_HOSTS.
I have already tried adding my server's fqdn in my hosts file and on that DJANGO_ALLOWED_HOSTS configuration in .env and still it won't let me access the web frontend.
Can someone please help?
Originally created by @hackdefendr on GitHub (Nov 8, 2025).
This is a brand new fresh installation and the only thing I did different was to put an Nginx reverse proxy in front of the app. DJANGO_ALLOWED_HOSTS is default, but it won't allow me to access and instead throws an HTTP 400 as shown below:
```
localhost | [2025-11-08 09:34:56] - ERROR - django.security.DisallowedHost - Invalid HTTP_HOST header: 'finance.knowelltech.net'. You may need to add 'finance.knowelltech.net' to ALLOWED_HOSTS.
localhost | Traceback (most recent call last):
localhost | File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
localhost | response = get_response(request)
localhost | ^^^^^^^^^^^^^^^^^^^^^
localhost | File "/usr/local/lib/python3.11/site-packages/django/utils/deprecation.py", line 119, in __call__
localhost | response = self.process_request(request)
localhost | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
localhost | File "/usr/local/lib/python3.11/site-packages/django/middleware/common.py", line 48, in process_request
localhost | host = request.get_host()
localhost | ^^^^^^^^^^^^^^^^^^
localhost | File "/usr/local/lib/python3.11/site-packages/django/http/request.py", line 202, in get_host
localhost | raise DisallowedHost(msg)
localhost | django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'finance.knowelltech.net'. You may need to add 'finance.knowelltech.net' to ALLOWED_HOSTS.
```
I have already tried adding my server's fqdn in my hosts file and on that DJANGO_ALLOWED_HOSTS configuration in .env and still it won't let me access the web frontend.
Can someone please help?
What does your DJANGO_ALLOWED_HOSTS variable looks like?
It should look something like this:
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] finance.knowelltech.net
@eitchtee commented on GitHub (Nov 8, 2025):
Hey there
What does your DJANGO_ALLOWED_HOSTS variable looks like?
It should look something like this:
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] finance.knowelltech.net
That was it. Order of operation. I had my hostname first and never tried it like you showed.
Thanks!!
@hackdefendr commented on GitHub (Nov 8, 2025):
> localhost 127.0.0.1 [::1] finance.knowelltech.net
That was it. Order of operation. I had my hostname first and never tried it like you showed.
Thanks!!
For future reference: the order should not matter, but who knows. Either way, glad you got it working, hoping you like the app.
@eitchtee commented on GitHub (Nov 8, 2025):
For future reference: the order should not matter, but who knows. Either way, glad you got it working, hoping you like the app.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @hackdefendr on GitHub (Nov 8, 2025).
This is a brand new fresh installation and the only thing I did different was to put an Nginx reverse proxy in front of the app. DJANGO_ALLOWED_HOSTS is default, but it won't allow me to access and instead throws an HTTP 400 as shown below:
I have already tried adding my server's fqdn in my hosts file and on that DJANGO_ALLOWED_HOSTS configuration in .env and still it won't let me access the web frontend.
Can someone please help?
@eitchtee commented on GitHub (Nov 8, 2025):
Hey there
What does your DJANGO_ALLOWED_HOSTS variable looks like?
It should look something like this:
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] finance.knowelltech.net
@eitchtee commented on GitHub (Nov 8, 2025):
Also, are you using HTTPS? If not, you may want to set HTTPS_ENABLED to false
@hackdefendr commented on GitHub (Nov 8, 2025):
That was it. Order of operation. I had my hostname first and never tried it like you showed.
Thanks!!
@eitchtee commented on GitHub (Nov 8, 2025):
For future reference: the order should not matter, but who knows. Either way, glad you got it working, hoping you like the app.