Hello everyone. I need help.
Summary:
certbot 1.12.0
nginx/1.22.0
Steps to reproduce:
I have a forwarding from port 80 to 433
server {
listen [::]:80;
listen 80;
server_name vmasshtabe.ru;
location / {
return 301 https://$host$request_uri;
set $root_path /var/www/vmasshtabe.ru/web;
root $root_path;
index index.html index.htm;
}
If you remove the redirect, the certificate is obtained successfully.
Expected result:
certbot certonly --dry-run -d vmasshtabe.ru -w /var/www/vmasshtabe.ru/web
IMPORTANT NOTES:
The dry run was successful.
Actual result:
curl -I https://vmasshtabe.ru/.well-known/acme-challenge/example.html
HTTP/2 200
server: nginx
date: Fri, 04 Oct 2024 18:45:22 GMT
content-type: text/html; charset=utf-8
content-length: 8
last-modified: Fri, 04 Oct 2024 11:17:20 GMT
etag: "66ffcec0-8"
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-ua-compatible: IE=Edge
accept-ranges: bytes
"challenges": [
{
"type": "http-01",
"url": "https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/14276984633/B5KBvQ",
"status": "invalid",
"validated": "2024-10-04T18:15:23Z",
"error": {
"type": "urn:ietf:params:acme:error:connection",
"detail": "185.12.95.219: Fetching https://vmasshtabe.ru/.well-known/acme-challenge/_2aJH8V8Qz3mTvzXRINo0-SGgRKzakl74nRmJeDt5zo: Redirect loop detected",
"status": 400
},
"token": "_2aJH8V8Qz3mTvzXRINo0-SGgRKzakl74nRmJeDt5zo",
"validationRecord": [
{
"url": "http://vmasshtabe.ru/.well-known/acme-challenge/_2aJH8V8Qz3mTvzXRINo0-SGgRKzakl74nRmJeDt5zo",
"hostname": "vmasshtabe.ru",
"port": "80",
"addressesResolved": [
"185.12.95.219",
"2a03:80c0:1:dea::"
],
"addressUsed": "2a03:80c0:1:dea::"
},
{
"url": "https://vmasshtabe.ru/.well-known/acme-challenge/_2aJH8V8Qz3mTvzXRINo0-SGgRKzakl74nRmJeDt5zo",
"hostname": "vmasshtabe.ru",
"port": "443",
"addressesResolved": [
"185.12.95.219",
"2a03:80c0:1:dea::"
],
"addressUsed": "2a03:80c0:1:dea::"
},
{
"url": "http://vmasshtabe.ru/.well-known/acme-challenge/_2aJH8V8Qz3mTvzXRINo0-SGgRKzakl74nRmJeDt5zo",
"hostname": "vmasshtabe.ru",
"port": "80",
"addressesResolved": [
"185.12.95.219",
"2a03:80c0:1:dea::"
],
"addressUsed": "185.12.95.219"
}
]
Tell me where to look for the problem?