Estou tentando configurar uma instância do Mastodon no Ubuntu 22.04. Configurei o Nginx como proxy reverso e agora estou tentando gerar um certificado SSL com Let's Encrypt. Quando executo certbot --nginx -d pacsa.us -v
, recebo esta saída:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Requesting a certificate for pacsa.us
Performing the following challenges:
http-01 challenge for pacsa.us
Waiting for verification...
Challenge failed for domain pacsa.us
http-01 challenge for pacsa.us
Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: pacsa.us
Type: unauthorized
Detail: 94.23.75.107: Invalid response from http://pacsa.us/.well-known/acme-challenge/LnWLQH7GlWEN4ODIF7Eh_8CLOUGhyOc5ZuHfu9LRexI: 404
Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.
Cleaning up challenges
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
Esta é a aparência do bloco do servidor da porta 80 em /etc/nginx/conf.d/mastodon.conf
:
server {
listen 80;
listen [::]:80;
server_name pacsa.us;
root /home/mastodon/public;
location /.well-known/acme-challenge/ { allow all; }
location / { return 301 https://$host$request_uri; }
}