I have a server running on a subdomain configured like so:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name x.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
<ssl configuration from https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=nginx-1.6.2&openssl=1.0.1t&hsts=no&profile=modern>
ssl_client_certificate /etc/ssl/certs/root-ca.crt;
ssl_verify_client on;
ssl_verify_depth 2;
root /var/www/html;
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
Currently, I'm using my own root CA both for the client verification and as the server's main certificate. I'd like to transition to using a Let's Encrypt certificate, but this poses a problem, since the Let's Encrypt verification process will require access to x.example.com/.well-known
and will not have a matching client certificate.
I've tried adding a second server block like so, as recommended here, but I haven't been able to get it to work:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name x.example.com;
<same Mozilla configuration--I've got it stored as a snippet>
ssl_verify_client off;
root /var/www/html;
index index.html index.htm;
location /.well-known {
try_files $uri $uri/ =404;
}
}
What is an appropriate way to do this?