在添加证书之前,我可以访问以下站点
http://website.com:4043/web/login
但是在添加证书之后,我无法使用https访问完整的URL。不过,我只能访问https://website.com
请给我支持。
发布于 2022-02-14 06:20:53
假设您正在运行一个现代版本的Ubuntu,您将希望确保您的Apache虚拟配置文件如下所示:
Listen 443
Listen 4043
ServerName website.com
SSLProxyEngine on
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
DocumentRoot /var/www/html
ServerName website.com
SSLProxyEngine on
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
DocumentRoot /var/www/html从这里开始,您可以设置一个快速的小.htaccess规则,以确保流量被正确地重定向到4043,而不是服务器默认的443。例如:
RewriteEngine on
# If the port isn't 4043
RewriteCond %{SERVER_PORT} !^4043$
# We redirect to the same address with the proper port
RewriteRule ^(.*)$ https://%{HTTP_HOST}:4043/$1 [R=301,L]重要:不要简单地复制和粘贴这些东西。看课文,为你自己的环境做些调整,除了你以外,其他人都不知道。
https://askubuntu.com/questions/1392787
复制相似问题