Estou usando acme.sh para criar um certificado para um servidor mais antigo, que preciso executar por vários motivos. No entanto, estou esquecendo de algo sobre a parte .well-known/acme-challenge.
Quando executo o script:
acme.sh --issue --nginx -d fish.pre.imb.co --test --debug 2
Recebo um erro:
fish.pre.imb.co:Verify error:197.214.119.177: Invalid response from https://fish.pre.imb.co/.well-known/acme-challenge/0wDIf77g9i9U1fx75tGX9UEOK_d4-A3ZdORclyTd14k: 404
Entretanto, se eu colocar um arquivo com o nome da consulta acima no diretório, ele será resolvido sem problemas.
Aqui está meu arquivo de configuração nginx:
upstream puma_fisheagle {
server 192.168.abc.xyz:1234 max_fails=3 fail_timeout=30s;
}
# IMB external system api server setup.
server {
resolver_timeout 10s;
server_name fish.pre.imb.co;
root /var/local/www/fisheagle/public;
access_log /var/log/nginx/fisheagle.log;
rewrite_log on;
try_files $uri/index.html $uri @puma_fisheagle;
location @puma_fisheagle {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 1800s;
proxy_redirect off;
proxy_pass http://puma_fisheagle;
proxy_connect_timeout 2;
}
location /.well-known/acme-challenge {
default_type "text/plain";
allow all;
root /var/local/www/acme;
}
location /nginx_status {
stub_status on;
access_log off;
allow 192.168.abc.0/24;
# deny all;
}
error_page 404 /404.html;
error_page 422 /422.html;
error_page 500 503 504 /500.html;
error_page 502 /502.html;
client_max_body_size 10m;
keepalive_timeout 10m;
listen 443 ssl;
ssl_certificate /etc/acme.sh/certs/fish.pre.imb.co/fullchain.cer;
ssl_certificate_key /etc/acme.sh/certs/fish.pre.imb.co/fish.pre.imb.co.key;
# intermediate configuration
# old configuration
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/private/ffdhe4096.pem;
ssl_ecdh_curve secp384r1;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
ssl_session_timeout 60m;
ssl_session_cache shared:SSL:50m;
}
server {
if ($host = fish.pre.imb.co) {
return 301 https://$host$request_uri;
}
server_name fish.pre.imb.co;
listen 80;
return 404;
}
Então parece que o acme não consegue gravar o arquivo no diretório? Quer dizer, se eu escrevê-lo manualmente, o config lê.
O que estou perdendo?
Aqui está o arquivo de depuração acme.sh: https://pastebin.com/6zHGAprA