Run it only once, the certificate gets replaced every time. Also if you run it too often you get rate limited by let’s encrypt and then you have to wait a certain time before you can renew your certs.
Certificate are issued for the specific domain. On an IP address, you will get cert warning by design. You need to use your DDNS even if at home to avoid cert warning.
Do you want to expand and replace this existing certificate with the new
certificate?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(E)xpand/(C)ancel: e
Renewing an existing certificate for YourDomain.com and nextcloud.YourDomain.com
Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/default
Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/default
Enhancement Strict-Transport-Security was already set.
Enhancement Strict-Transport-Security was already set.
Traffic on port 80 already redirecting to ssl in /etc/nginx/sites-enabled/default
Traffic on port 80 already redirecting to ssl in /etc/nginx/sites-enabled/default
Failed staple-ocsp for nextcloud.YourDomain.com
Unable to set enhancement staple-ocsp for nextcloud.hemertje.com
An error occurred while enabling OCSP stapling for {'nextcloud.YourDomain.com'}.
IMPORTANT NOTES:
- We were unable to set up enhancement staple-ocsp for your server,
however, we successfully installed your certificate.
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/YourDomain.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/YourDomain.com/privkey.pem
Your certificate will expire on 2023-03-30. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again with the "certonly" option. To non-interactively
renew *all* of your certificates, run "certbot renew"
[FAILED] DietPi-LetsEncrypt | Certbot failed, please check its above terminal output. Aborting...
Press any key to return to the DietPi-LetsEncrypt menu ...
is it preferred to use wild card ssl certificate or individual for each sub domain?
I read somewhere they mentioned wild card ssl certificate is better as with individual we can expose our history of domain like with this tool https://crt.sh
Wildcard cert is something that you can’t create that easy. It requires some more work and is not supported by our tools actually. Just search the web on how to create such cert.
Can you have a look with me regarding the confog lines in:
With https:///nextcloud/ I get the error:
Your connection is not private
Cybercriminals may be trying to steal your information from <ip address> (for example, passwords, messages, or credit card information). More information
NET::ERR_CERT_COMMON_NAME_INVALID
In this section, the server will be reachable thanks to a subdomain of your domain name, forwarded by your router to your machine hosting Nextcloud. Your Nextcloud server will then be reachable at http://nextcloud.my_domain, for instance.
Let note the /nextcloud has disappeared.
They refer to /etc/nginx/conf.d/nextcloud.conf
But in DietPi there is no /etc/nginx/conf.d/nextcloud.conf
You should stop trying to setup these sub domain feature. It could be way more simply.
Better to go back to the beginning and start with an empty clean Nginx configuration file.
Once done run dietpi-letsencrypt and create the 2 cert you like. Doesn’t matter of these are domain and sub domain. Just enter them both commas separated.
you should have HTTPS access to Nginx default web site on both, domain and sub domain
the default config file contains two nearly same looking sections, for each domain one.
go to section for your sub domain and adjust the root directory. Should looks like this now
server {
root /var/www/nextcloud;
index index.php index.html index.htm index.nginx-debian.html;
server_name sub.domain.com; # managed by Certbot
go to NC config file /var/www/nextcloud/config/config.php and adjust value overwrite.cli.url
remove the sub path /nextcloud. Should looks like this now
'overwrite.cli.url' => 'https://sub.domain.com',
restart Nginx
done, NC is reachable on https://sub.domain.com now