証明書の取得で以下のコマンドを実行すると
certbot certonly --webroot -w /var/www/html -d ドメイン名
404エラーが出てしまいます。
Failed authorization procedure. ドメイン名 (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://ドメイン名/.well-known/acme-challenge/c64FrhERnUaweQbOvXDmquOaRDPXyKXWTeCR0U102zQ: "<html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>" IMPORTANT NOTES: - The following errors were reported by the server: Domain: ドメイン名.com Type: unauthorized Detail: Invalid response from http://ドメイン名.com/.well-known/acme-challenge/c64FrhERnUaweQbOvXDmquOaRDPXyKXWTeCR0U102zQ: "<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/AAAA record(s) for that domain contain(s) the right IP address.
nginx.confでルートは設定しても同様のエラーです。解決策を教えていただけると助かります。
location ^~ /.well-known/acme-challenge/ { allow all; root /var/www/html; }
nginx.comf
user nginx; worker_processes 1; error_log /var/log/nginx/error.log debug; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; server { listen 80; server_name 〇〇.com; root /var/www/html; } server { listen 443 ssl; server_name 〇〇.com; charset UTF-8; # LetsEncrypt location ^~ /.well-known/acme-challenge/ { allow all; root /var/www/html; } }
ちなみに、nginxを起動した状態と停止させた状態でも実行しましたがエラーでした。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/14 18:42
2018/05/14 22:13 編集