如果我按照这个说明,我就能得到你好世界!在浏览器上。
获得域名后,使用cloud dns将虚拟机外部IP指向该域名,我也能够获得hello world!在浏览器输入域名后,例如newdany.us.to
现在我想使用 SSL,https://newdany.us.to,以便浏览器向我返回 hello world!与 https。我能够使用谷歌管理的证书创建我的 https lb。证书已正确提供。我还在 Cloud DNS 上进行了更改以指向新的 LB IP,但是当我输入 https://newdany.us.to
时收到此错误upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: 111
我希望社区能够为我指明正确的方向,需要在服务器内部进行更改,以便 https 正常工作。预先感谢您。
我的 000-default.conf 文件如下
<VirtualHost *:80>
ServerName newdany.us.to
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
我已在 000-default.conf 文件中添加了这一行 ServerName newdany.us.to,但我不确定这是否正确。
将 John Hanley 先生的评论发布为答案。
虽然可以在
000-default.conf,
中包含主机名,但更常见的做法是禁用此默认配置,并为您希望 Apache 服务的每个域创建单独的虚拟主机配置。
许多在线教程提供了有关虚拟主机的详细说明以及在 Apache 中有效设置虚拟主机的指导。