400 Bad Request
" response to API clients./opt/vmware/vcloud-director/logs/vcloud-container-debug.log
shows a warning that the request is rejected:| WARN | pool-jetty-# | HostCheckerFilter | Rejecting request with host header: #.#.#.# | requestId=<request ID>,request=GET https://#.#.#.#/api/versions
VMware Cloud Director
This behaviour is expected when host header verification is enabled in Cloud Director as outlined in the documentation, Network Security Requirements for VMware Cloud Director.
The Cell Management Tool is used to enable this option:
/opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n vcloud.http.enableHostHeaderCheck -v true
When host header verification is enabled Cloud Director will only accept API requests sent to either the public address of Cloud Director, the addresses of the Cloud Director Cells, and additional addresses added to the CORS allowed origins.
To allow additional addresses pass host header verification add them to the CORS allowed origins list using the Cloud Director API:
To disable host header verification the option can be removed using the Cell Management Tool:
/opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n vcloud.http.enableHostHeaderCheck -l
/opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n vcloud.http.enableHostHeaderCheck -d
/opt/vmware/vcloud-director/bin/cell-management-tool cell -i $(service vmware-vcd pid cell) -s
systemctl stop vmware-vcd
systemctl start vmware-vcd