2

I'm setting up a mail server using iRedMail and have everything installed and running. Now trying to change the self signed certificate for a Lets Encrypt using the certbot-auto client. I have added

location ~ /.well-known {
    allow all;
}

into /etc/nginx/templates/misc.tmpl like this

location ~ /.well-known {
    allow all;
}

# Deny all attempts to access hidden files such as .htaccess.
#location ~ /\. { deny all; }

# Handling noisy messages
location = ^/favicon.ico { access_log off; log_not_found off; }
location = ^/robots.txt { log_not_found off; access_log off; allow all; }

However when I restart nginx and browse to the URL, I get a 404, and certbot-auto also reports a 404.

I've placed it above the rule to restrict access to hidden files, so this should work.

Any ideas would be massively appreciated. Thanks in advance.

Luke P
  • 723
  • 7
  • 19

1 Answers1

1
location /.well-known {
alias /opt/www/iredadmin/.well-known/;
}