need to connect Django project with NGINX, certbot and ngrok

55 Views Asked by At

I have a Django project, made a file /etc/nginx/sites-enabled/griphr-backend which include :

server {
   listen 80;
   server_name 31bb-156-220-68-78.ngrok-free.app;

   location / {
       proxy_pass http://localhost:8000; # Django app runs on port 8000
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
   }
}

used the ngrok to get this domain 31bb-156-220-68-78.ngrok-free.app

I run this command:

sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Now when run sudo certbot certonly --nginx -d 31bb-156-220-68-78.ngrok-free.app get this:

Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
Domain: 31bb-156-220-68-78.ngrok-free.app Type: unauthorized
Detail: 2600:1f16:d83:1202::6e:2: Invalid response from https://acme.ngrok.com/.well-known/acme-challenge/BpCRbnqugK_D_Wys3DOw-5FOQQ8fuWQss1ZMFNuTpO4?host=31bb-156-220-68-78.ngrok-free.app: 404

Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.

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.

How make certbot work to generare ssl cert?

0

There are 0 best solutions below