我需要为我的主站点(sub.main.co.in)的子域设置vhost配置。
我的dockerfile是这个-
COPY . /var/www/html
COPY .docker/vhost.conf /etc/apache2/sites-available/000-default.conf
COPY .docker/sslvhost.conf /etc/apache2/sites-available/default-ssl.conf
我的vhost.conf是这个-
<VirtualHost *:80>
<Directory "/var/www/html/">
AllowOverride all
Require all granted
</Directory>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.undostres\.com.mx$
RewriteRule ^(.*)$ https://%1.undostres.com.mx/$1 [R=302,L]
</VirtualHost>
我的sslvhost.conf是这个-
<VirtualHost *:443>
DocumentRoot /var/www/html/
SSLEngine On
<Directory "/var/www/html/">
AllowOverride all
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log
</VirtualHost>
但是,所需的http-> https行为不存在。