acez.nginx

nginx

自己署名のSSL証明書と Let's Encrypt ワイルドカード証明書のDNSチャレンジをサポートするnginxコンテナをセットアップするための役割です。

制限事項

現時点では、DNSチャレンジはnetcup DNSのみサポートされており、1つのドメインに対してのみ使用できます。これは、nginx_config_netcup_domainで設定されています。

要件

この役割を機能させるためには、対象のマシンにDockerとDockerコンテナを管理するためのすべての依存関係をインストールする必要があります。

役割の変数

設定キー 説明 デフォルト
nginx_container_name 起動したnginxコンテナのコンテナ名。 nginx
nginx_container_networks 起動したコンテナのDockerネットワークのリスト。
nginx_image_name nginxイメージ名の上書き。独自のイメージを提供する場合に使用します。 nginx
nginx_image_tag 使用されるnginxイメージのタグ。 stable
nginx_config_expose_ports Docker形式での公開ポートのリスト。(例:- "80:80") - "80:80"
- "443:443"
nginx_filesystem_root nginxファイル用のファイルシステム上のパス。
nginx_filesystem_sites サイトの設定が保存されているファイルシステム上のパス。
nginx_filesystem_ssl SSL証明書が保存されているファイルシステム上のパス。
nginx_config_cert_email SSL証明書のメールアドレス。
nginx_config_letsencrypt_dns_challenge_provider Let's EncryptのDNSチャレンジのプロバイダー。現在はnetcupのみサポート。 netcup
nginx_config_letsencrypt_account_email Let's Encryptのアカウントメール。
nginx_config_letsencrypt_acme_directory Let's EncryptのACMEディレクトリ。ステージングまたは本番環境。 https://acme-v02.api.letsencrypt.org/directory
nginx_config_sites nginxサイトのリスト。
nginx_config_netcup_api_key NetcupのAPIキー。
nginx_config_netcup_api_password NetcupのAPIパスワード。
nginx_config_netcup_customer_id NetcupのカスタマーID。
nginx_config_netcup_domain Netcupのドメイン。

nginx_config_sitesの変数

変数名 説明 デフォルト
hostname サイトのホスト名。ファイル名にもなります。
ssl_provider SSLプロバイダーを指定します。 self-signed, letsencrypt
path_config パス設定のリスト。

path_configの変数

変数名 説明
location 設定するHTTPサイトのロケーション。
proxy_pass proxy_passのためのパス。
configuration パスの追加nginx設定。nginxのパス設定に1対1で配置されます。

nginx_config_sitesの例

nginx_config_sites:
  - hostname: my.domain.com
    ssl_provider: letsencrypt
    path_config:
      - location: "/"
        proxy_pass: "http://internal-host:8080"
      - location: "/my-grafana-installation"
        proxy_pass: "http://internal-host-2:3000"
        configuration:
          - "rewrite /grafana/(.*) /$1  break;"

依存関係

ライセンス

MIT

プロジェクトについて

Ansible role to setup a nginx container

インストール
ansible-galaxy install acez.nginx
ライセンス
mit
ダウンロード
190
所有者
Developer based in Ulm, Germany