I use this command to renew cert:
sudo certbot certonly --webroot -w /var/www/html -d domain.xx -d www.domain.xx
I get this error
Detail: Invalid response from
http://www.domain.xx/.well-known/acme-challenge/VocRf2hD_egNkF6ck8ZuaPgTJEwk
My nginx settings have this settings for SSL configurration:
location /.well-known {
allow all;
root /var/www/html;
}
I made a file called “testfile123” in this folder “/var/www/html/.well-known/acme-challenge/” and can access it by typing in this URL “www.domain.xx/.well-known/acme-challenge/testfile123”
This is my full server config:
upstream server {
server unix:/home/user/projects/site/gunicorn.sock fail_timeout=10s;
}
server {
listen 8002;
listen [::]:80;
# Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
access_log /home/user/projects/logs/site_access.log;
error_log /home/user/projects/logs/site_error.log info;
server_name domain.xx www.domain.xx;
client_max_body_size 10M;
# RSA certificate
ssl_certificate /etc/letsencrypt/live/domain.xx/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.xx/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
location / {
proxy_pass http://unix:/home/user/projects/site/gunicorn.sock;
proxy_pass_header Server;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IPP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
location /static {
alias /home/user/projects/site/static;
}
location /media {
alias /home/user/projects/site/site/media;
}
# SSL Configuration
location /.well-known {
allow all;
root /var/www/html;
}
}