Answer the question
In order to leave comments, you need to log in
Why is there a 404 error when the file is in the directory?
Hello!
Such a problem: I tried to get an ssl certificate for the site - for this I created two
.well-known folders in the root and acme-challenge in it and threw the file into the last one without specifying the extension.
When you try to check the file, you get a 404 error despite the fact that it is in the directory.
I tried to throw it in the directory above, i.e. in .-well-known , then it is visible.
What could be the problem please
Answer the question
In order to leave comments, you need to log in
1. Check the permissions on the acme-challenge folder, the webserver may not be allowed to read them. You need '-rx' for the user under which the web server (or its groups) is running.
2. The web server config must contain
Alias /.well-known/acme-challenge/ /u/www/virtual/letsencrypt/.well-known/acme-challenge/
<Directory "/ваш путь на сервере/.well-known/acme-challenge/">
Options None
AllowOverride None
ForceType text/plain
Order allow,deny
Allow from all
RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
</Directory>
RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
# Пусть .weel-known лежит в папке /var/www/letsencrypt
location /.well-known {
allow all;
root /var/www/letsencrypt;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question