Unable to generate Letsencrypt Certificate with the script

I have a domain name let suppose “sub.mydomain.com” pointing to my Public IP address and it is working fine now. I have crossed check all the config and A/AAA records and all are perfect. When I run the script, I get an error on http 01 challenge. A complete error is shown in the image attached here. How can I resolve this issue? I have installed it with apache2.

You can see the http link that the Let’s Encrypt servers try to reach, can you reach it?
I see our apache2 config configures http virtualhost that does a redirect, maybe that thing is blocking it, if you can temporary add some apache config that will allow http://youserver.com/.well-known… to work …

Yes, I have tried that also. I created a directory and uploaded a text file in the acme-challenge folder and tried reading the txt by visiting http://mydomain.com/.well-known/acme-challenge/file.txt. It was reaching that point and testing was successful but again received another error Invalid Doc Type when run the script. Now I am trying with https://community.letsencrypt.org/t/missing-acme-challenge-folder/77760/5 … I need to know what apache2 config required to allow access to .well-known location.

Can you try this, modifying it to match your current config, replacing current *:80 config:

<VirtualHost *:80>
    ServerName jitsi-meet.example.com

    <Location /.well-known/>
        Options None
        AllowOverride None
        Allow from all
    </Location>

    Redirect permanent / https://jitsi-meet.example.com/
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(?!/\.well-known/acme-challenge/).* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

If it works I will add it to our apache2 default template.

Hi, Yes…I did it…Still not working.

I am able to access mydomain.com/.well-known/acme-challenge/test

We also have same issue with this. Tried to follow the Location and tried running but received same error.

I tried generating with correcting NAT config from router side and it worked. Problem Resolved.