gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 09:53:32 26 4
gpt4 key购买 nike

所以我尝试在脚本中稍微自动化 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 而无需询问此问题?

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

最佳答案

使用--redirect

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


documentation安全 部分

enter image description here

关于nginx - Certbot,指定重定向而不回答问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61973786/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com