Certbot,指定重定向而不回答问题

问题描述 投票:1回答:1

因此,我试图在脚本中自动化certbot。当我运行此sudo certbot --nginx -d your_domain -d www.your_domain

我得到以下内容:

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):

我的问题是,我可以以某种方式使它自动选择选项号2而不问这个问题吗?

换句话说,以某种方式在2命令中指定了选项sudo certbot --nginx -d your_domain -d www.your_domain,而没有交互作用。

nginx certbot
1个回答
0
投票

使用--redirect

sudo certbot --nginx --redirect -d your_domain -d www.your_domain


documentation安全部分

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.