jpnewman.nginx
jpnewman.nginx
This Ansible role sets up an Nginx proxy.
Requirements
- Ansible version 2.x
Role Variables
geerlingguy.nginx
Variable | Description | Default |
---|---|---|
nginx_vhosts |
Keep this as is for this role. | [] |
nginx_remove_default_vhost |
Keep this as is for this role. | true |
jpnewman.nginx | defaults
Variable | Description | Default |
---|---|---|
nginx_vhost_available_path |
Path for available vhosts. | /etc/nginx/sites-available |
nginx_vhost_path |
Path for enabled vhosts. | /etc/nginx/sites-enabled |
jpnewman.nginx | Simple Reverse Proxy Template (nginx_reverse_proxy.conf.j2)
Variable | Description | Default |
---|---|---|
nginx_vhost_filename |
Name of the vhost file. | localhost |
www_redirect |
Redirect www to non-www. | false |
listen_ports |
Ports to listen on. | 80 |
host_aliases |
Aliases for the host. | [] |
max_upload_size |
Maximum upload size. | "1024m" |
host_name |
Host name for the server. | localhost |
redirect_http |
Redirect HTTP to HTTPS. | false |
ssl_enabled |
Enable SSL. | false |
ssl_listen_ports |
Ports for SSL. | [] |
ssl_cert_path |
Path to SSL certificate. | "" |
ssl_key_path |
Path to SSL key. | "" |
proxy_pass_port |
Port for proxy pass. | 8080 |
server_auth_method |
Authorization method for the server. | "" |
nginx_log_dir |
Directory for Nginx logs. | "/var/log/nginx" |
nginx_error_log |
Path to error log. | "{{ nginx_log_dir }}/error.log" |
nginx_access_log |
Path to access log. | "{{ nginx_log_dir }}/access.log" |
nginx_template_file |
Template file name for Nginx. | nginx_reverse_proxy.conf.j2 |
jpnewman.nginx | Multiple vhost template
Variable | Description | Default |
---|---|---|
nginx_vhosts_data |
Data for multiple vhosts. | |
nginx_acl_rules |
Access control list rules. |
For examples, check the following files within this role:
test/templates/defaults/artifactory.yml
test/templates/defaults/drupal.yml
test/templates/defaults/kibana_reverse_proxy.yml
test/templates/defaults/multiple_vhosts.yml
Custom Templates
You can use any custom template with the nginx_template_file
variable, and place the required variables in host_vars
, group_vars
, etc.
Dependencies
- geerlingguy.nginx
Example Playbook
- hosts: servers
roles:
- { role: jpnewman.nginx, tags: ["nginx"] }
License
MIT / BSD
Author Information
John Paul Newman
Installa
ansible-galaxy install jpnewman.nginx
Licenza
mit
Download
5.5k
Proprietario
Software Engineer with DevOps working on both Windows and *nix.