我的脑子都吓坏了。我没有发现错误!我只想要一些子域:
CLOUD、BITWARDEN和NORMAL(例如CLOUD.example.com、tresor.example.com和example.com(
:80云->:443云(作品(
:80比特典狱长->:443正常(错误(
:443位管理员->:443比特管理员(工程(
:80正常->:443正常(工作(
# CLOUD
<VirtualHost *:443>
SSLEngine on
ServerName cloud.example.com
ServerAlias *.cloud.example.com
DocumentRoot /var/www/cloud.example.com/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/subexample2/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/subexample2/privkey.pem
</VirtualHost>
<VirtualHost *:80>
ServerName cloud.example.com
ServerAlias *.cloud.example.com
Redirect permanent / https://cloud.example.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =cloud.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# BITWARDEN
<VirtualHost *:443>
SSLEngine on
ServerName tresor.example.com
ServerAlias *.tresor.example.com
ProxyPass / http://127.0.0.1:8000/
ProxyPreserveHost On
ProxyRequests Off
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/subexample2/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/subexample2/privkey.pem
</VirtualHost>
<VirtualHost *:80>
ServerName tresor.example.com
ServerAlias *.tresor.example.com
Redirect permanent / https://tresor.example.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =tresor.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# NORMALE example
<VirtualHost *:443>
ServerName example.com
ServerAlias *.example.com
DocumentRoot /var/www/subexample/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/subexample2/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/subexample2/privkey.pem
</VirtualHost>
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
Redirect permanent / https://example.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>```
好的,我发现了:
我删除了每一个:80 vhost,并在文件顶部创建了一个。
<VirtualHost *:80>
RewriteEngine on
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>