【发布时间】:2019-12-11 20:05:59
【问题描述】:
我的网站在 SSL 证书上运行不正常。
该网站在我的配置文件中使用 SSLEngine off 指令的 443 端口上正常工作,SSLEngine on 响应 503 错误。
它还默认连接到端口 80,我真的不知道在哪里更改它,因为我到处都设置了端口 443。
.htaccess 文件:
RewriteEngine On
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(.*)$ https://www.antoszbk.xyz/$1 [R,L]
配置文件(正常工作时):
<VirtualHost *:443>
ServerAdmin xxx@xxx.com
DocumentRoot /var/www/html/index.html
ServerName antoszbk.xyz
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine off
SSLCertificateFile /etc/ssl/certs/www.antoszbk.xyz.csr
SSLCertificateKeyFile /etc/ssl/private/www.antoszbk.xyz.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
【问题讨论】:
-
“默认情况下它也在端口 80 上连接” - “它”是使用纯 HTTP 作为默认浏览器,其中没有显式协议(如
https://)给定的。
标签: html ssl websocket apache2