I’m setting up a new subdomain. These are my records (I’ve redacted a few things):
<VirtualHost *:80>
ServerAdmin ----@riverside.rocks
ServerName ----.riverside.rocks
ServerAlias http://---.riverside.rocks
DocumentRoot /var/www/---
RemoteIPHeader CF-Connecting-IP
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin ---@riverside.rocks
ServerAlias https://----.riverside.rocks
DocumentRoot /var/www/---/
RemoteIPHeader CF-Connecting-IP
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/---.riverside.rocks/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/---.riverside.rocks/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
However, when I visit my site over HTTPS, apache uses the cert for riverside.rocks and not my subdomain:
What is wrong with my config?