I'm trying to generate a certificate for my wordpress website with letsencrypt. I'm using NGinx as webserver.
I tried many things, but everything seems to fail and i still get the same error message (the command I use is sudo certbot --nginx
but i also tried with : sudo certbot --nginx --d www.mywebsite.fr
) :
Failed authorization procedure. mywebsite.fr (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://mywebsite.fr/.well-known/acme-challenge/q9Ck4GJMSTpqiJAQXUz47ShS544l40Kx1u3DN3mDa90 [51.158.126.54]: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: mywebsite.fr
Type: unauthorized
Detail: Invalid response from
http://mywebsite.fr/.well-known/acme-challenge/q9Ck4GJMSTpqiJAQXUz47ShS544l40Kx1u3DN3mDa90
[51.158.126.54]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
Not Found</h1></center>\r\n<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.
My DNS files is ok (i checked with a nslookup
).
I tried creating a .well-known/acme-challenge directory but this didn't solve the problem.
I also tried modifying my .htaccess file, but it didn't work neither. It looks like this :
RewriteRule "^.well-known/acme-challenge" - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^\.well-known/.+ - [END]
# BEGIN WordPress
# Les directives (lignes) entre 'BEGIN WordPress' et 'END WordPress' sont
# généré dynamiquement, et ne doivent uniquement être modifiées via les filtres WordPress.
# Toute modification des directives entre ces marqueurs sera outrepassée.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /www/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /www/index.php [L]
</IfModule>
# END WordPress
Does someone has any clue on this ?
Thanks in advance.