I use the “return 300” to go from http to https. But if I do not comment this line, the letsencrypt command does not work I can deal with it for the first time, but I get the same problem with the renew…
So I guest I do not use the good config… Where am I wrong ?
If your HTTPS configuration is correct, there should not be a problem. Unfortunately, you’re just saying “the … command does not work” without actually telling us the error et cetera. Please give us the full output of the command you used.
Because putting it in the server scope directly prevents that other location block from applying. Hypothetically (I can't test it because of obscured domain) if you then had an nginx location block in your HTTPS server that blocked access to "dotfiles", that could explain your current symptoms.
I don’t think the HTTP to HTTPS redirect should be outside the HTTP server scope.
The error presented is pretty clear: there is an forbidden error on the HTTPS site of @thierryler server. (Let’s Encrypt has followed the redirect perfectly…)
In the above configuration, the “allow all” for the .well-known directory is only in the HTTP server configuration.
Yes, that can be a way to go as well. The reason I did not suggest it is that OP did not post the full virtual host, and the ordering of regex-based locations with nginx can be very subtle. Potentially, that location could get overriden by a dotfile location.
So I felt the safer way was to avoid the redirect entirely and complete the challenge on port 80.
It definitely should be, if you want to have any other location blocks inside the server scope.
How can I force the renew on my server ? It says that it is skipped:
The following certs are not due for renewal yet:
/etc/letsencrypt/live/sgp4.fr/fullchain.pem expires on 2019-10-11 (skipped)
/etc/letsencrypt/live/www.sgp4.fr/fullchain.pem expires on 2019-10-11 (skipped)
The names differ based on how you installed Certbot.
certbot-auto and letsencrypt-auto refer to a “portable” version of Certbot that uses virtualenv and avoids installing itself into your package manager. More info here: https://certbot.eff.org/docs/install.html#certbot-auto
certbot usually refers to a version of Certbot that is installed from a package repository.
Which one should you use? You should follow the instructions from https://certbot.eff.org for your operating system and webserver.
Installing from git is usually not recommended. But I don’t think anything will go wrong with your server if you keep using letsencrypt-auto.