Estoy usando Let's Encrypt para mi dominio. Creé la configuración para ejemplo.com, www.ejemplo.com, app.ejemplo.com Ejemplo.com y www.ejemplo.com funcionan bien y apuntan a /var/www/html, pero app.ejemplo. com siempre está redirigiendo a example.com, que se supone que apunta a /var/www/app
Aquí está mi ssl.conf
<IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin webmaster@localhost ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on <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 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/example.com-0001/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com-0001/privkey.pem </VirtualHost> <VirtualHost *:443> ServerAdmin webmaster@localhost ServerName app.example.com DocumentRoot /var/www/app ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /var/www/app> Order allow,deny allow from all </Directory> BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/app.example.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/app.example.com/privkey.pem </VirtualHost> </IfModule>¡Estoy confundido acerca de lo que se ha perdido aquí!
El problema está arreglado. El subdominio se configuró en 2 certificados diferentes, por lo que cuando generé un certificado separado solo para el subdominio, el problema se resolvió.