My domain is: grepolis-update.php-test.de
I ran this command (as root): certbot certonly --nginx --rsa-key-size 4096
(and selected grepolis-update.php-test.de)
It produced this output:
Failed authorization procedure. grepolis-update.php-test.de (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://grepolis-update.php-test.de/.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA [167.86.110.125]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0</ce"
My web server is: nginx 1.18.0 (with ModSecurity)
The operating system my web server runs on is (include version): Debian 10.4
My hosting provider, if applicable, is: not applicable
I can login to a root shell on my machine: yes
I'm using a control panel to manage my site: no
The version of my client is: certbot 0.31.0
.
Complete description of my case:
My problem is: I already have other pages in the nginx config where the certificates were issued without problems. (e.g. api.chirmi.info - if someone wants to check that...)
Neither the configuration (of the http/80 server) nor the software versions were changed.
server {
modsecurity on; modsecurity_rules_file /etc/nginx/modsec/main.conf; listen 80; root /var/www/cert; server_name grepolis-update.php-test.de; location / { return 301 https://$server_name$request_uri; } location ^~ /.well-known { try_files $uri $uri/ =404; }}
The configuration also seems to work, because I get the following access log after the failed certbot command. (404 - not 301)
18.196.96.172 - - [20/Jun/2020:02:11:28 +0200] "GET /.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA HTTP/1.1" 404 125 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" "-"
3.14.255.131 - - [20/Jun/2020:02:11:29 +0200] "GET /.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA HTTP/1.1" 404 125 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" "-"
34.222.229.130 - - [20/Jun/2020:02:11:29 +0200] "GET /.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA HTTP/1.1" 404 125 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" "-"
64.78.149.164 - - [20/Jun/2020:02:11:29 +0200] "GET /.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA HTTP/1.1" 404 125 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" "-"
If I create the folders manually (mkdir -p /var/www/cert/.well-known/acme-challenge/) and create this file as a test (echo "test" > /var/www/cert/.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA), I can retrieve it with my browser as usual.
<MY-IP-ADDRESS> - - [20/Jun/2020:02:24:48 +0200] "GET /.well-known/acme-challenge/j61o90QIBEuN08AqZ5s0sWmx2O_cLRTG6P5LnAMgbCA HTTP/1.1" 200 3 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0" "-"
Does anybody have an idea what else could be the reason for this?
(I'm still hoping that I'm just tired and missing something obvious.)

