hispanico.nginx_revproxy

ansible-role-nginx_revproxy

複数のウェブサイトのためにNginxをリバースプロキシとしてインストールし、設定します。

GitHub 品質 ダウンロード数 Galaxy バージョン
CI quality downloads Galaxy Version

要件

このロールはAnsible 2.4以上が必要です。

ロール変数

デフォルト値:

nginx_revproxy_sites:                                         # リバースプロキシするサイトのリスト
  default:                                                    # デフォルトサイトを444(接続が応答なしでクローズ)を返すように設定
    ssl: false                                                # httpをhttpsにリダイレクトしたい場合はTrueに設定
    letsencrypt: false

  example.com:                                                # ドメイン名
    domains:                                                  # server_nameエイリアスのリスト
      - example.com
      - www.example.com
    upstreams:                                                # アップストリームのリスト
      - { backend_address: 192.168.0.100, backend_port: 80 }
      - { backend_address: 192.168.0.101, backend_port: 8080 }
    auth:                                                     # シングルHTTPユーザー/パスワードを定義するブロック、または認証なしのvhostsの場合は未定義にする
      login: myusername
      password: mysecretpassword
    extra_locations:                                           # 追加のロケーションを追加するためのブロック、または追加のロケーションが必要ない場合は未定義にする
      websocket:                                              # 追加のロケーション名
        upstreams:                                            # 追加のロケーション用のアップストリームのリスト
          - { backend_address: 192.168.0.102, backend_port: 8088 }
    listen: 9000                                              # クリアHTTPがリッスンするポートを指定、または未定義のまま80を使用
    ssl: false                                                # httpをhttpsにリダイレクトしたい場合はTrueに設定
    letsencrypt: false                                        # letsencryptを使用したい場合はTrueに設定
    conn_upgrade: true                                        # Connectionアップグレードヘッダーの値を設定
    acls:                                                     # 特定のクライアントアドレスへのアクセスを制限(値はアドレス、CIDR、unixまたは全て)
      - { mode: allow, value: 192.168.0.1 }
      - { mode: deny, value: all }

  example.org:                                                # ドメイン名
    domains:                                                  # server_nameエイリアスのリスト
      - example.org
      - www.example.org
    upstreams:                                                # アップストリームのリスト
      - { backend_address: 192.168.0.200, backend_port: 80 }
      - { backend_address: 192.168.0.201, backend_port: 8080 }
    listen: 9000                                              # クリアHTTPがリッスンするポートを指定、または未定義のまま80を使用
    listen_ssl: 9001                                          # HTTPSがリッスンするポートを指定、または未定義のまま443を使用
    ssl: true                                                 # httpをhttpsにリダイレクトしたい場合はTrueに設定
    ssl_certificate: /etc/ssl/certs/ssl-cert-snakeoil.pem     # ssl証明書、letsencryptがfalseの場合に使用
    ssl_certificate_key: /etc/ssl/private/ssl-cert-snakeoil.key # ssl証明書キー、letsencryptがfalseの場合に使用
    letsencrypt: false                                        # letsencryptを使用したい場合はTrueに設定
    letsencrypt_email: ""                                     # letsencrypt証明書用のメールを設定

nginx_revproxy_certbot_auto: false                             # certbot-autoをインストールする場合はtrueに設定

nginx_revproxy_certbot_packages:                              # certbot-autoを使用しない場合はリポジトリからこれらのパッケージをインストール
  - certbot
  - python3-certbot-nginx

依存関係

なし。

例のプレイブック

  - hosts: all
    roles:
      - hispanico.nginx_revproxy
    vars:
      nginx_revproxy_sites:
        default:
          ssl: false
          letsencrypt: false

        example.com:
          domains:
            - example.com
            - www.example.com
          upstreams:
            - { backend_address: 192.168.0.100, backend_port: 80 }
            - { backend_address: 192.168.0.101, backend_port: 80 }
          ssl: true
          letsencrypt: false

ライセンス

GPLv3ライセンスの下でライセンスされています。詳細についてはLICENSEファイルを参照してください。

著者情報

Hispanico

プロジェクトについて

Manage Nginx as Reverse Proxy

インストール
ansible-galaxy install hispanico.nginx_revproxy
ライセンス
gpl-3.0
ダウンロード
69.4k
所有者
@openwisp Contributor and @ninuxorg Member