Renew HTTP 404 error

Hello,

I am trying to renew my certificates and I am getting the http404 error. If I am honest I don’t know what I am really doing or how I got it working in the first place.

Going through the posts with similar errors, I realised that I couldn’t find the acme-challenge folder, so I created one and now I can do a /.well-known/acme-challenge/success.html test.

The only other thing I can think of is that my nginx.conf file might have something wrong with it

Please can you help point me in the right direction.

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: www.nchanga.com

I ran this command: certbot-auto renew

It produced this output: Saving debug log to /var/log/letsencrypt/letsencrypt.log


Processing /etc/letsencrypt/renewal/nchanga.com.conf

Cert is due for renewal, auto-renewing…
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for nchanga.com
http-01 challenge for www.nchanga.com
Waiting for verification…
Cleaning up challenges
Attempting to renew cert (nchanga.com) from /etc/letsencrypt/renewal/nchanga.com.conf produced an unexpected error: Failed authorization procedure. www.nchanga.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.nchanga.com/.well-known/acme-challenge/8OA3U2GkAuPFT09FUJ5_Y_fasOTw0L-TDH7V3vqKT0Y: "

404 Not Found

404 Not Found


", nchanga.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://nchanga.com/.well-known/acme-challenge/4_qvplS6NdxyAL1od5smyyV3u88dQJ7BE640ZmDNl0A: " 404 Not Found

404 Not Found


". Skipping. All renewal attempts failed. The following certs could not be renewed: /etc/letsencrypt/live/nchanga.com/fullchain.pem (failure)

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/nchanga.com/fullchain.pem (failure)

1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:

My web server is (include version): nginx

The operating system my web server runs on is (include version): OSMC

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

Have you got a firewall or anything blocking access externally ? I can’t reach nchanga.com

Nothing blocking, access seems fine I can reach nchanga.com externally and my sites are up.

Can you get to “http” for nchanga.com ? i.e port 80 ? I can’t

or are you just checking “https” on port 443 ?

The requests you show from Lets Encrypt are trying on port 80 - as they are based on the http-01 challenge.

What serverco said seems correct.

Note also that becuase your HTTPS site is using HSTS (the Strict-Transport-Security header), it may seem to redirect from HTTP to HTTPS when you visit it in a browser; however this is just the effect of the browser remembering the header and connecting to HTTPS immediately. The Let’s Encrypt validation server won’t do that; it will always try HTTP first (if you use --webroot as it seems you did).

Ok. I have had a problem with my router before, it does like to forward port 80, I have plugged my old one in.

And you are still getting the same error? Or a different error?

If it’s the same, maybe you have the wrong webroot directory? Check what the webroot is set to in your renewal configuration file (in /etc/letsencrypt/renewal/) and confirm that if you place a test file in that directory, you can access it in a browser.

It might also be worth trying the nginx plugin - certbot-auto --nginx

Good news - certbot-auto --nginx -d nchanga -d ww.nchanga.com worked.

However if I put a test file in my webroot directory I get a 404 error, so there must be something wrong somewhere.

Thanks for all the help.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.