I want to implement a LetsEncrypt acme-challenge location statement globally for any server_name which ever will be requested.
So I wrote the following server block :
server {
server_name ~^(.+)$;
listen 80;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /etc/nginx/ssl/le;
allow all;
}
}
From what I think I know, I understand that if there is an exact match of a server-block, my server-block above will not be invoked.
Is there any trick how to accomplish it without ever touching the actual server-blocks of the domains?
I'm even fine with an if-statement
0 Answers