在我的 apache 错误日志中,我有一堆 ssl 警告保存 You configured HTTPS(443) on the standard HTTP(80) port!
这是我的 site.ca.conf
文件
<VirtualHost *:80>
ServerName site.ca:80
DocumentRoot "/var/www/site/public"
<Directory "/var/www/site/public">
AllowOverride all
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =site.ca
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
这是我的 site.ca-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName site.ca:80
DocumentRoot "/var/www/site/public"
<Directory "/var/www/site/public">
AllowOverride all
</Directory>
ServerAlias site.ca
SSLCertificateFile /etc/letsencrypt/live/site.ca/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/site.ca/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
一切正常。我不确定为什么这个警告每天都出现在我的 Apache 日志文件中,我该如何解决?
最佳答案
一般来说,这是因为您在虚拟主机的443端口上没有任何SSL配置。您可能需要启用“SSLEngine on”并提供证书信息。该警告表明正在为通常为 HTTPS 端口的常规 HTTP 流量提供服务。
关于linux - 您在标准 HTTP(80) 端口上配置了 HTTPS(443),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59605857/