SSL on Maindomain - subdomain to AWS

Hello everyone,

today I successfully installed nextcloud on an AWS EC2 instance and connected the application to a S3 bucket.

Now I am trying to get the SSL running.
I have a main domain www.mydomain.com with an ssl certificate.
I want to use a subdomain like nextcloud.mydomain.com to forward me the AWS Public DNS (IPv4)

Unfortunatly I keep getting an unauthorized type error when use lets encrypt cmd.
I added the A/AAAA record for the subdomain aswell the main domain, but it doesnt seem to work.

Did somebody came acress the same error and could help me out with the ssl forwarding?

Thanks in advanced

could you post the complete certbot error message? (without your real domain/ip)

i’m developing my playbooks an aws using nextcloud.mydomain.com. it worked hundreds of times.

you may try. just follow the readme.

The keywords AWS, EC2 I do not know, are they specific to your provider?

You need to add alternate name entries to your certificate, for www.mydomain.com and nextcloud.mydomain.com.

FYI: AWS | Amazon Elastic Compute Cloud (EC2)

sorry for my late response. This is the error message I get.
Even thought the DNS A/AAAA record is entered correctly, and the SSL certificate is for the main domain and all the subdomains.

Waiting for verification…
Cleaning up challenges
Failed authorization procedure. nextcloud.mydomain.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://nextcloud.mydomain.com/.well-known/acme-challenge/_DIIrjEXQuXI4M72JWv_z9j27IDuiykxogfRP2teq2k [2001:8d8:100f:f000::214]: 204
IMPORTANT NOTES: