[ad_1]
I had the same problem and none of the answers resolved my problem. For resolving situations like this, it’s best to enable logging by adding the following config to settings.py
temporarily.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/tmp/debug.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
When you see the issue, it’s easier to handle than by blind debugging.
My issue was:
Invalid HTTP_HOST header: ‘pt_web:8000’. The domain name provided is not valid according to RFC 1034/1035.
I resolved it by adding proxy_set_header Host $host;
to the Nginx config file and enabling port forwarding with USE_X_FORWARDED_PORT = True
in the settings.py
(it’s because in my case I was listening to requests on Nginx port 8080
and passing to guni
on port 8000
).
[ad_2]