Getting an SSL certificate

Hello! I want to get an SSL certificate for pure HA:

./certbot-auto certonly --standalone --preferred-challenges http-01 --email [email protected] -d my.secret.domain

I receive an error:

 - The following errors were reported by the server:

   Domain: {secret}
   Type: unauthorized
   Detail: Invalid response from
   http: // {secret} /.well-known/acme-challenge/7pDSWR2O-7y7NKcWm1JAIAEMKVhDczWIAG16wGUqTZM
   [secret IP]: 404

   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.

Please tell me why I get this error?

I assume your domain is pointed to your public IP address? And the ports are forwarded to your internal host?

domain to my dedicated IP address, 80 external port - redirected to 8123 internal RPi port

while that script is running you need to have port 80 forwarded to 80 on the rpi.

Thanks, it really helped.