Configured Django + gunicorn + nginx server. Debug = false Periodically, different messages come from Jhangi, but the following is not clear how it happened. Here is the message:

"Invalid HTTP_HOST header: u '/ project_path / run / gunicorn.sock:'. It’s not valid according to RFC 1034/1035"

I quote below the rest of the code sent to me by mail:

 Request repr(): <WSGIRequest path:/, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{}, META:{'HTTP_CONNECTION': 'close', 'HTTP_X_FORWARDED_FOR': '94.102.49.210', 'PATH_INFO': u'/', 'QUERY_STRING': '', 'RAW_URI': '/', 'REMOTE_ADDR': '', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': u'', 'SERVER_NAME': '/путь_к_проэкту/run/gunicorn.sock', 'SERVER_PORT': '', 'SERVER_PROTOCOL': 'HTTP/1.0', 'SERVER_SOFTWARE': 'gunicorn/19.1.1', 'gunicorn.socket': <socket._socketobject object at 0x7f4ce037f2f0>, 'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWraper object at 0x7f4ce0f59ad0>, 'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>, 'wsgi.input': <gunicorn.http.body.Body object at 0x7f4ce17f0550>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> 
  • invalid header If a single message - do not worry, just a rare exception, if frequent - you need to look at what request arises. I recommend to install sentry, there is more information about errors and more convenient, you can see how often the error repeats - Alexey Starodubtsev

1 answer 1

from comment:


Invalid header.

If a single message - do not worry, just a rare exception, if frequent - you need to look at what request arises.

I recommend to install sentry, there is more information about errors, and more convenient: you can see how often the error repeats.