登陆Openstack dashboard ,页面出错,信息如下:
Something went wrong!
An unexpected error has occurred. Try refreshing the page. If that doesn't help, contact your local administrator.
查看httpd日志报如下错误信息:
/var/log/httpd/error_log
[Thu Dec 11 06:54:32 2014] [error] "Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host)
[Thu Dec 11 06:54:32 2014] [error] SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): 10.20.0.10
错误原因:
django有个ALLOWED_HOSTS的配置,有允许的域名可以解析到服务器IP上。
解决方法:
在/etc/openstack-dashboard/local_settings 里面找到ALLOWED_HOSTS,加入想要解析的域名,
修改后:
ALLOWED_HOSTS = ['10.20.0.10','controller0','horizon.example.com', 'localhost']
重启httpd服务即可
service httpd restart