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., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: sudo certbot --nginx -d -d

It produced this output:

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

404 Not Found



  • The following errors were reported by the server:

    Type: unauthorized
    Detail: Invalid response from
    [2a03:b0c0:3:d0::cae:6001]: “\r\n404 Not
    Found\r\n<body bgcolor=“white”>\r\n

    Not Found


    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 “” part. I edited my nginx file into following:

server {
listen 80;
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 -


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.


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.


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