chadek.nginx_certbot

Ansible 角色: Nginx Certbot

这个 Ansible 角色自动化设置 Nginx 网络服务器,使用 Certbot 部署 HTTPS 加密,使用 Let's Encrypt 证书。

要求

  • 控制节点上安装 Ansible。
  • 域名指向运行 Nginx 的服务器。

角色变量

以下是此角色中使用的变量及其描述:

  • nginx_certbot_domain_name: 将获取 SSL 证书的域名。
  • nginx_certbot_certbot_email: 用于 Let's Encrypt 证书注册的电子邮箱地址。
  • nginx_certbot_deny_http: 启用 HTTPS 后是否禁止 HTTP 访问。默认值为 false
  • nginx_certbot_proxy_protocol: 是否启用对 nginx PROXY 协议的支持。默认值为 false
  • nginx_certbot_app: Nginx 提供服务的应用程序配置:
    • name: 应用程序名称。
    • url: 应用程序托管的 URL。
    • http_template_name: Nginx HTTP 模板名称。模板示例可在 templates 目录找到。
    • upstream_template_name: Nginx 上游模板名称。模板示例可在 templates 目录找到。

这些变量可以在你的 playbook 中进行自定义,以符合你的特定环境和配置要求。

依赖关系

无。

示例 Playbook

- hosts: web_servers
  roles:
    - role: chadek.nginx_certbot
      vars:
        nginx_certbot_domain_name: app.example.com
        nginx_certbot_certbot_email: [email protected]
        nginx_certbot_deny_http: false
        nginx_certbot_proxy_protocol: false
        nginx_certbot_app:
          name: app
          url: "http://localhost:2000"
          http_template_name: root
          upstream_template_name: root_upstream

许可

此角色采用 MIT 许可。

作者信息

此角色由 Chadek 创建。

反馈与贡献

如果你有任何反馈或想要贡献,请随时在 GitHub 上提出问题或提交请求。

关于项目

ansible role to install and setup nginx with https server templates using certbot for linux

安装
ansible-galaxy install chadek.nginx_certbot
许可证
gpl-3.0
下载
470
拥有者