An error occurs during the challenge:
Type: unauthorized
Detail: Invalid response from
http://app.test.ru/.well-known/acme-challenge/Tcz1WXPz5Q-CjQlAIzJ2Y69langzO-zTfjxKF5UDyDk:
"
404 Not Found
" ``` ``` There are 2 configs for load balancers: app.conf and lb1.conf **app.conf** ``` upstream lb { server lb1.test.ru; server lb2.test.ru; }
server {
listen 80;
server_name app.test.ru;
location / {
return 301 https://app.test.ru$request_uri;
}
location /.well-known/acme-challenge/ {proxy_pass http://lb;}
}
**lb1.conf**
upstream backend {
server app1.test.ru;
server app2.test.ru;
check interval=1000 rise=1 fall=2 timeout=1000 type=http;
check_http_send "GET /status HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
server {
listen 80;
server_name app1.test.ru;
access_log /var/log/nginx/log.access.log themain;
location / {return 201;}
location /status {return 200;}
}
server {
listen 80;
server_name app2.test.ru;
access_log /var/log/nginx/log.access.log themain;
location / {return 202;}
location /status {return 200;}
}
server {
listen 80;
server_name lb1.test.ru;
location /.well-known/acme-challenge {root /opt/www/acme;}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
}
}
on the second load balancers app.conf is the same
**lb2.conf**
upstream backend {
server app1.test.ru;
server app2.test.ru;
check interval=1000 rise=1 fall=2 timeout=1000 type=http;
check_http_send "GET /status HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
server {
listen 80;
server_name app1.test.ru;
access_log /var/log/nginx/log.access.log themain;
location / {return 201;}
location /status {return 200;}
}
server {
listen 80;
server_name app2.test.ru;
access_log /var/log/nginx/log.access.log themain;
location / {return 202;}
location /status {return 200;}
}
server {
listen 80;
server_name lb2.test.ru;
location /.well-known/acme-challenge {proxy_pass http://lb1.test.ru;}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
}
}
2 app1 and app2 servers (identical):
server {
listen 80;
location / {
set_real_ip_from unix:;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
proxy_pass http://127.0.0.1:8080;
}
}
I start receiving with the sudo letsencrypt cert only --dry-run --webroot -w /opt/www/acmed command app.test.ru
i am tested curl
- - [12/Nov/2021:18:32:36 +0000] "GET /.well-known/acme-challenge/12345.txt HTTP/1.1" 404 162 "-" "curl/7.68.0"