Lets Encrypt cannot verify the domain when Site Redirection is set. This is because NGINX does not set a specific directory (root dir) for the acme challenge. As a result, Lets Encrypt is redirected to the Site Redirection URL, which does not display the verification file; thus, Lets Encrypt is failing to process the SSL certificate.
How to reproduce:
> Create hosting package
> Setup site redirection (e.g. google.nl > google.com)
> Request SSL certificate (e.g. google.nl)
Problem:
NGINX does not point to a specific directory for the /well-known/acme-challenge.
Solution
Add the following lines:
Under the following lines:
In the following NGINX vhost files:
Then run:
How to reproduce:
> Create hosting package
> Setup site redirection (e.g. google.nl > google.com)
> Request SSL certificate (e.g. google.nl)
Problem:
NGINX does not point to a specific directory for the /well-known/acme-challenge.
Solution
Add the following lines:
Bash:
location ^~ /.well-known/acme-challenge/ {
root |DOCROOT|/.well-known/acme-challenge/;
default_type "text/plain";
allow all;
}
Under the following lines:
Bash:
root |DOCROOT|;
index index.php index.html index.htm;
In the following NGINX vhost files:
Bash:
/usr/local/directadmin/data/templates/custom/nginx_server_secure.conf
/usr/local/directadmin/data/templates/custom/nginx_server.conf
Then run:
Bash:
/usr/local/directadmin/custombuild/build rewrite_confs
Last edited: