![Django 无效的 HTTP_HOST 标头:'\x80\xc7\xda\x9e'](https://linux22.com/image/679642/Django%20%E6%97%A0%E6%95%88%E7%9A%84%20HTTP_HOST%20%E6%A0%87%E5%A4%B4%EF%BC%9A'%5Cx80%5Cxc7%5Cxda%5Cx9e'.png)
我收到了托管在 Digital ocean 上的 Django 1.7 应用程序的错误。
无效的 HTTP_HOST 标头:“\x80\xc7\xda\x9e”。根据 RFC 1034/1035,提供的域名无效。
Request repr():
<WSGIRequest
path:/xmlrpc.php,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'HTTP_CONNECTION': 'close',
'HTTP_HOST': '\x80\xc7\xda\x9e',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0)Gecko/20100101 Firefox/10.0',
'HTTP_X_FORWARDED_FOR': '181.214.92.100',
'PATH_INFO': u'/xmlrpc.php',
'QUERY_STRING': '',
'RAW_URI': '/xmlrpc.php',
'REMOTE_ADDR': '181.214.92.100',
'REMOTE_PORT': '80',
'REQUEST_METHOD': 'POST',
'SCRIPT_NAME': u'',
'SERVER_NAME': '\x80\xc7\xda\x9e',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SOFTWARE': 'gunicorn/18.0',
'gunicorn.socket': <socket._socketobject object at 0x7fb05e3e1280>,
'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fb0663e01e0>,
'wsgi.file_wrapper': <class gunicorn.http.wsgi.FileWrapper at 0x7fb063c1b7a0>,
'wsgi.input': <gunicorn.http.body.Body object at 0x7fb05e3bf810>,
'wsgi.multiprocess': False,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>
我已在基础文件中设置了 ALLOWED_HOSTS=['*']。此错误的原因是什么?我该如何解决?