Django - nginx - ubuntu 18.04

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: kril.live

I ran this command: sudo certbot --nginx -d kril.live -d www.kril.live

It produced this output:

Failed authorization procedure. kril.live (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://kril.live/.well-known/acme-challenge/6TJ67KswUh5YmmydiUpHtfG-ZqbZE11jAN130MSuLvA [2a03:b0c0:3:d0::cae:6001]: “\r\n404 Not Found\r\n<body bgcolor=“white”>\r\n

404 Not Found

\r\n

IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: kril.live
    Type: unauthorized
    Detail: Invalid response from
    http://kril.live/.well-known/acme-challenge/6TJ67KswUh5YmmydiUpHtfG-ZqbZE11jAN130MSuLvA
    [2a03:b0c0:3:d0::cae:6001]: “\r\n404 Not
    Found\r\n<body bgcolor=“white”>\r\n

    404
    Not Found

    \r\n

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A/AAAA record(s) for that domain
    contain(s) the right IP address.

My web server is (include version): nginx version: nginx/1.14.0 (Ubuntu)

The operating system my web server runs on is (include version): Ubuntu 18.04

My hosting provider, if applicable, is: digitalocean

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):certbot 0.31.0

I think I have trouble with “http://kril.live/.well-known/acme-challenge/6TJ67KswUh5YmmydiUpHtfG-ZqbZE11jAN130MSuLvA” part. I edited my nginx file into following:

server {
listen 80;
server_name kril.live www.kril.live;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/kril/goldberg;
}

location / {
    include proxy_params;
    proxy_pass http://unix:/run/gunicorn.sock;
}
location ^~ /.well-known/acme-challenge/ {
    alias /var/www/acme-challenge/;
}

}

Still no luck. Differently though, I don’t get error with django debug page but regular 404 if I add well-known part in nginx config.

1 Like

Hi @bonellia

checking your domain you have ipv4 and ipv6 - addresses - https://check-your-website.server-daten.de/?q=kril.live

There

you see: Letsencrypt prefers ipv6 checking your domain.

But your server block

doesn’t have an ipv6 listen. Add

listen [::]:80;

restart your nginx, then try it again.

2 Likes

Thank you sir, I was suspecting something with ipv6 and it seems you were right.
(I was so eager to try again after adding listen [::]:80 part, forgot to restart nginx, but it still worked anyways, because I think when it asked me about http redirection, it had to restart nginx anyways. Just a small detail.)

Unfortunately I can’t reach my django app anymore, but I suppose this is another fix.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.