Getting error while generating ssl in ec2 instance

I am deploying my django project on aws ec2 instance. When I tested my application with out ssl I am able to access it. But When I try to generate the ssl for my domain I am getting this error mentioned below.

here is my conf file:

server{
    listen 80;
    server_name interview.fitai.me;


    location ^~ /.well-known/acme-challenge/ {
      allow all;
      root /var/www/html;
      default_type "text/plain";
      try_files $uri =404;
    }

    location /{
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;

    }
}

My domain is: interview.fitai.me

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

It produced this output : Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: interview.fitai.me
Type: unauthorized
Detail: 2a02:4780:11:934:0:2e79:6fe1:2: Invalid response from http://interview.fitai.me/.well-known/acme-challenge/rb6FragdGmFIPOf7jkoj0MU1I1tUYCdwjzhkKUF8M0Q: 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.

The operating system my web server runs on is (include version): ubuntu 24.04

Cerbot Version = 2.9.0

1 Like

Openrasty answers your challenge page; is that right?

1 Like

Sorry I did not understood the question.

Your DNS has an IPV6 address and one for IPV4. Let's encrypt prefers the IPv6 and is getting a response from a Lightspeed server at that IP. You need to correct the IP address to point to your nginx server or remove it if you do not support IPV6.

5 Likes

Thanks I understood the problem and now Issue is resolved.

4 Likes

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