How can I define a server block that applies to all virtual hosts?
Aka have a universal block to configure SSL for all subdomains (they use the same cert)
server {
listen 80;
server_name *.example.com;
return 301 https://$host$request_uri;
}
# Have a block like this that does SSL for all subdomains
server {
listen 443 ssl ;
listen [::]:443 ssl;
server_name *.example.com;
ssl_certificate /certs/live/example.com/cert.pem;
ssl_certificate_key /certs/live/example.com/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
}