Hello, have you search correctly ?
Since this is a Q&A I actually didn't want to start a discussion.
You answered right after I solved my problem and decided to post here. But even if the thread had been there a few days earlier I don't think that it would have helped me a lot. Not because your answer is bad in any way but I simply don't know what to do with these information. None of the links you provided have the code location ^~ /.well-known/acme-challenge/ {} which I found helpful. But it gave me a few more keywords to search for and I kind of found the answer to my problem:
# Rule for legitimate ACME Challenge requests (like /.well-known/acme-challenge/xxxxxxxxx)
# We use ^~ here, so that we don't check other regexes (for speed-up). We actually MUST cancel
# other regex checks, because in our other config files have regex rule that denies access to files with dotted names.
location ^~ /.well-known/acme-challenge/ {
# Set correct content type. According to this:
# https://community.letsencrypt.org/t/using-the-webroot-domain-verification-method/1445/29
# Current specification requires "text/plain" or no content header at all.
# It seems that "text/plain" is a safe option.
default_type "text/plain";
# This directory must be the same as in /etc/letsencrypt/cli.ini
# as "webroot-path" parameter. Also don't forget to set "authenticator" parameter
# there to "webroot".
# Do NOT use alias, use root! Target directory is located here:
# /var/www/common/letsencrypt/.well-known/acme-challenge/
root /usr/share/nginx/html;
}
# Hide /acme-challenge subdirectory and return 404 on all requests.
# It is somewhat more secure than letting Nginx return 403.
# Ending slash is important!
location = /.well-known/acme-challenge/ {
return 404;
}
Alles anzeigen
But how should a beginner like me know were to put these code snippets? Even better: How should I know that this is the problem und not my router which isn't forwarding port 443 correctly or nginx not listening to the right port?