Centos 7, nginx. К двум доменам test1.domen.info и test2.domen.info нужно получить один сертификат Let’s Encrypt. На единственный домен на сервере (domen.info) сертификат был получен через certbot. Конфиг nginx был таким:
server {
listen 80;
server_name domen.info www.domen.info;
location / {
root /var/www/html;
index index.html index.htm;
}
location ^~ /.well-known/acme-challenge {
default_type "text/plain";
root /var/www/html;
}
location = /.well-known/acme-challenge/ {
return 404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
certbot certonly -a webroot --webroot-path=/var/www/html -d domen.info
server {
server_name test1.domen.info www.test1.domen.info;
access_log /var/log/nginx/test1.domen.info.log;
location / {
root /var/www/test1.domen.info;
index index.htm index.html;
}
location ^~ /.well-known/acme-challenge {
default_type "text/plain";
}
}
server {
server_name test2.domen.info www.test2.domen.info;
access_log /var/log/nginx/test2.domen.info.log;
location / {
root /var/www/test2.domen.info;
index index.htm index.html;
}
location ^~ /.well-known/acme-challenge {
default_type "text/plain";
}
}
certbot certonly -a webroot --webroot-path=/var/www/html -d test1.domen.info -d www.test1.domen.info -d test2.domen.info -d www.test2.domen.info -d
Центр сертификации не может проверить сайт на запись.
Failed authorization procedure. www.test1.domen.info (http-01): urn:acme:error:unauthorized ::
The client lacks sufficient authorization ::
Invalid response from http://www.test1.domen.info/.well-known/acme-challenge/_F_CqFNHF8DaQVtv6fhHONHVnlKvKgQvj46Q8_mO46g: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.test1.domen.info
Type: unauthorized
Detail: Invalid response from
http://www.test1.domen.info/.well-known/acme-challenge/_F_CqFNHF8DaQVtv6fhHONHVnlKvKgQvj46Q8_mO46g:
"<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.
Пробую менять путь и синтаксис запроса
certbot certonly --webroot -w /var/www/test1.domen.info -d test1.domen.info -d www.test1.domen.info -w /var/www/test2.domen.info -d test2.domen.info -d www.test2.domen.info
certbot certonly --webroot -w /var/www/test1.domen.info -d test1.domen.info -d www.test1.domen.info -w /var/www/test2.domen.info -d test2.domen.info -d www.test2.domen.info
Синтаксис вроде правильный, ткните носом, где именно мной не дописаны разрешения?