By Mark Adel
I have followed this tutorial to secure nginx with lets encrypt for this domain and sub domain example.com and www.example.com (my domain instead of example)
Now I have another sub domain something.example.com, it’s pointing to my VPS and I created an ngnix server block to serve static content for it. Now how do I use python-certbot-nginx package to secure the new sub domain?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi ! If you have create your vhost to your subdomain, you have just to do this command :
Install Certbot :
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
./letsencrypt-auto certonly --standalone
Certificate your subdomain :
sudo ./certbot-auto certonly --standalone -d sub.domain.com
It works fine for me. Don’t forget to restart nginx :
service nginx reload
Guys I can’t access my subdomain on http, its shows on https. Here are my nginx config.
listen 80 default_server;
Hey, I discovered that there is a handy certbot cli command (works on ubuntu 16.04) simply type:
certbot
Gives you something like that:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: [editted]
2: [editted]
3: [editted]
4: [editted]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.