Mirror HanXHX/ansible-nginx dari GitHub.
 
 
Go to file
Emilien Mantel a50d7e8774 Test proxy with a real back-end: himself 2015-10-09 14:31:01 +02:00
defaults First shot proxy (unstable) 2015-10-08 18:21:40 +02:00
files/web Moving files 2015-07-15 15:42:32 +02:00
handlers Vhost static OK (dirty) 2015-07-15 15:18:51 +02:00
meta Migrate to jinja block ok 2015-07-30 13:02:21 +02:00
tasks First shot proxy (unstable) 2015-10-08 18:21:40 +02:00
templates/etc/nginx First shot proxy (unstable) 2015-10-08 18:21:40 +02:00
tests Test proxy with a real back-end: himself 2015-10-09 14:31:01 +02:00
vars First shot proxy (unstable) 2015-10-08 18:21:40 +02:00
.gitignore Init repo 2015-07-15 12:14:39 +02:00
.travis.yml Test travis docker 2015-10-07 19:31:12 +02:00
LICENSE Initial commit 2015-07-15 12:12:06 +02:00
README.md Fix badge 2015-10-07 19:25:57 +02:00
Vagrantfile Init repo 2015-07-15 12:14:39 +02:00

README.md

Nginx for Debian Ansible role

Ansible Galaxy Build Status

Install and configure Nginx on Debian.

This role is not production ready. SSL management wille come later.

Requirements

None.

Role Variables

  • nginx_apt_package: APT nginx package (try: apt-cache search ^nginx)
  • nginx_root: root directory where you want to have your files
  • nginx_log_dir: log directory (if you change it, don't forget to change logrotate config)
  • nginx_ssl_dir: directory where you install your SSL/TLS keys
  • nginx_resolver: list of DNS resolver (default: OpenDNS)
  • nginx_error_log_level: default log level
  • nginx_dh_length: DH key length (default is 2048)

PHP

  • nginx_php: boolean if you need to preconfigure PHP (default: false)
  • nginx_php_sockets: list of //sockets//

You should see Nginx upstream module doc.

Socket:

  • unix_socket
  • host
  • port
  • weight
  • max_fails
  • fail_timeout

Nginx Configuration

  • nginx_user
  • nginx_worker_processes
  • nginx_events: key/value in events block
  • nginx_http: key/value in http block

Vhost management

  • nginx_vhosts: List of dict. A vhost has few keys. See bellow.

  • name: (M) List of domain used. The first occurence is the most important!
  • template: (M) template used to create vhost
  • enable: (O) Enable the vhost (default is true)
  • delete: (O) Delete the vhost (default is false)
  • redirect_from: (O) Domain list to redirect to the first name. You can use this key to redirect non-www to www
  • location: (O) Add new custom locations (it does not overwrite!)
  • more: (O) Add more custom infos.
  • upstream_params: (O) Add upstream params (useful when you want to pass variables to PHP)

(O) : Optional (M) : Mandatory

Templates

  • base: static template
  • php: PHP base template. Can work with many frameworks/tools.
  • wordpress
  • dokuwiki

Templates works as parent-child.

You can see many examples in: tests/test.yml.

Dependencies

None

Example Playbook

- hosts: servers
  roles:
     - { role: HanXHX.nginx }

License

GPLv2

Author Information