lunik.nginx
Ansible Role: Nginx
This role installs Nginx on Linux and sets up the service and website templates.
Requirements
No special requirements.
Role Variables
Variable | Type | Description |
---|---|---|
nginx_ssl_source_cert_path |
string | Path to the SSL certificate on the Ansible master |
nginx_ssl_source_key_path |
string | Path to the SSL key on the Ansible master |
nginx_ssl_source_passphrase_path |
string | Path to the SSL key passphrase on the Ansible master |
nginx_ssl_protocols |
list(string) | List of SSL/TLS protocols to use |
nginx_ssl_ciphers |
string | List of SSL/TLS ciphers to use |
nginx_config_site_only |
boolean | If set to true, only configure the site without installing Nginx |
nginx_sites |
list(object) | List of website configurations |
nginx_sites
This part explains how to set up an Nginx site.
Each site
has these attributes:
Variable | Type | Description |
---|---|---|
enabled |
boolean | Whether the site is enabled on the Nginx server |
params |
map(any) | A set of parameters for the Nginx server |
Dependencies
No dependencies.
Example Playbook
- 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
License
Author Information
This role was created in 2019 by Lunik (Guillaume MARTINEZ).
Maintainer(s)
Informazioni sul progetto
Install and configure Nginx service and sites
Installa
ansible-galaxy install lunik.nginx
Licenza
mit
Download
106
Proprietario
Ansible, GitLab, k8s/helm, Terraform, OCI Contributor