我在我的Digital Ocean Debian机器上build立了一个网站,就像我以前做过十几次一样。 这一次,当我访问http://example.com ,它redirect到https(我不知道如何或为什么),我得到一个“您的连接不安全”的浏览器错误,当我查看细节它说:
example.com使用无效的安全证书。
该证书仅对以下名称有效:
another.example.net,www.another.example.net错误代码:SSL_ERROR_BAD_CERT_DOMAIN
我还没有为example.com设置SSL证书,但它试图使用其他SSL证书。
这是sites-enabled/example.com.conf文件
<VirtualHost *:80> ServerAdmin alan@localhost DocumentRoot /var/www/html/example.com ServerName example.com ServerAlias www.example.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteEngine on RewriteCond %{SERVER_NAME} =www.example.com [OR] RewriteCond %{SERVER_NAME} =example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent] </VirtualHost>
为什么要使用其他证书?