Topic: Letsencrypt cannot find my .well-known
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.0 PGSQL edition.
- Deployed with iRedMail Easy or the downloadable installer? Downloadable bash script
- Linux/BSD distribution name and version: OpenBSD 7.1 AMD64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
$doas certbot certonly --webroot --dry-run -w /opt/www/ -d maildotmyexampledomaindotcom
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: maildotmyexampledomaindotcom
Type: unauthorized
Detail: My.IP.V4.Add: Invalid response from https:// maildotmyexampledomaindotcom/.well-known/acme-challenge/8h6_c4gDtPvseoVnX6r3nP0bCbF_v0WDdv-QWCctwug: 404
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Some challenges have failed.
$ cat /var/www/logs/access.log
54.93.193.16 - - [21/Jun/2022:13:40:59 +0530] "GET /.well-known/acme-challenge/8h6_c4gDtPvseoVnX6r3nP0bCbF_v0WDdv-QWCctwug HTTP/1.1" 301 162 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https:// wwwdotletsencryptdotorg)"
66.133.109.36 - - [21/Jun/2022:13:40:59 +0530] "GET /.well-known/acme-challenge/8h6_c4gDtPvseoVnX6r3nP0bCbF_v0WDdv-QWCctwug HTTP/1.1" 301 162 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https:// wwwdotletsencryptdotorg)"
I created directory and file in /opt/www/.well-known/index.html. After creating .well-known I chowned it to iredadmin:iredadmin as well.
when I browse to myexampledomaindotcom/index.html I get relevant error log entries
$ cat /var/www/logs/error.log
2022/06/21 13:25:30 [error] 24305#0: *1 access forbidden by rule, client: 122.200.21.226, server: _, request: "GET /.well-known/index.html HTTP/2.0", host: "maildotmyexampledomaindotcom"
However, there's no error log for letsencrypt trying to access the resource
$cat /etc/nginx/templates/misc.tmpl
location ^~ /.well-known/acme-challenge/ {
#alias /opt/www/.well-known/;
allow all;
access_log off;
log_not_found off;
autoindex off;
#root /var/www/html;
}
# Deny all attempts to access hidden files such as .htaccess.
location ~ /\. { deny all; }
I am totally new to nginx and have tried searching elsewhere. Please help.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.