我正在使用Vagrant和Apache2,具体是使用以下命令:
vagrant share --https 443
一切似乎都很顺利,并提供了一个URL。当我访问该URL时,会出现400错误:
错误请求
您的浏览器发送了一个服务器无法理解的请求。 Apache/2.4.12 (Ubuntu) Server at *.vagrantshare.com Port 443
我一直都可以正常使用https访问vagrant机器,但它似乎不喜欢与vagrant共享共同工作。
这是一个已知的 Vagrant Share bug: https://github.com/webdevops/vagrant-docker-vm/issues/51
我看到的唯一解决方法是使用自定义域名或完全使用另一个产品(例如 ngrok)来创建共享。请参阅此处的错误讨论:https://github.com/mitchellh/vagrant/issues/5493#issuecomment-159792794
有关自定义域的 Vagrant Share 文档在此处:https://atlas.hashicorp.com/help/vagrant/shares/custom-domains
vagrant share
,https流量将自动转到:443
。 - Brian Brownton--https 443
应该被视为可靠结果的必要选项。 - Ethan