lunik.nginx
Ansible ロール: Nginx
LinuxにNginxをインストールし、サービスとテンプレートサイトを設定します。
要件
特になし。
ロール変数
変数 | 型 | 説明 |
---|---|---|
nginx_ssl_source_cert_path |
文字列 | Ansibleマスター上のSSL証明書のパス |
nginx_ssl_source_key_path |
文字列 | Ansibleマスター上のSSLキーのパス |
nginx_ssl_source_passphrase_path |
文字列 | Ansibleマスター上のSSLキーのパスフレーズのパス |
nginx_ssl_protocols |
リスト(文字列) | SSL/TLSで使用するプロトコルのリスト |
nginx_ssl_ciphers |
文字列 | SSL/TLSで使用する暗号のリスト |
nginx_config_site_only |
真偽値 | サイト設定のみを実行します。Nginxサービスのインストールをバイパスする |
nginx_sites |
リスト(オブジェクト) | サイトオブジェクトのリスト |
nginx_sites
このセクションでは、Nginxサイトの設定方法を説明します。
各site
は次の属性で定義されます:
変数 | 型 | 説明 |
---|---|---|
enabled |
真偽値 | Nginxサーバーでサイトを有効にするかどうか |
params |
マップ(任意) | Nginxサーバーで受け入れられるすべてのパラメータのマップ |
依存関係
特になし。
サンプルプレイブック
- hosts: localhost
vars:
nginx_ssl_source_cert_path: "/path/to/ssl/cert.crt"
nginx_ssl_source_key_path: "/path/to/ssl/cert.key"
nginx_ssl_source_passphrase_path: "/path/to/ssl/cert.passphrase"
nginx_sites:
- name: my-app
enabled: yes
params:
server_name: "my-app.local"
location:
path: /
params:
proxy_pass: "http://127.0.0.1:5000"
- name: my-app
enabled: yes
params:
server_name: "my-app.local"
root: /var/www/html
index: index.html
location:
path: /
params:
try_files: "$uri $uri/ =404"
roles:
- lunik.nginx
ライセンス
著者情報
このロールは2019年にLunik (Guillaume MARTINEZ)によって作成されました。