Reputation: 745
So I'm trying to automate certbot a bit in a script.
When I run this sudo certbot --nginx -d your_domain -d www.your_domain
I get the following:
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
My question is,
Can I somehow make it so that it automatically selects the option number 2
without asking this question?
In other words, somehow specifying option 2
in the sudo certbot --nginx -d your_domain -d www.your_domain
command without it being interactive.
Upvotes: 5
Views: 4582
Reputation: 43934
Use --redirect
sudo certbot --nginx --redirect -d your_domain -d www.your_domain
Upvotes: 8