Mirror HanXHX/ansible-nginx dari GitHub.
 
 
Go to file
Emilien Mantel 0788b6c84f Delete PHP upstream when nginx_php is empty
Closes #31
2017-12-07 11:09:44 +01:00
defaults Let's encript certificate with acme.sh 2017-12-03 01:32:56 +01:00
doc Fix site.state == absent 2017-12-06 12:05:46 +01:00
filter_plugins Remove heavy code (nginx filename) using a filter 2017-10-26 15:33:00 +02:00
handlers Restart nginx on SSL file writes 2017-11-03 10:30:24 +01:00
meta Travis major changes: 2017-06-06 14:15:03 +02:00
tasks Delete PHP upstream when nginx_php is empty 2017-12-07 11:09:44 +01:00
templates/etc _php template, do not go to /index.php as fallback 2017-12-05 10:40:21 +01:00
tests Let's encript certificate with acme.sh 2017-12-03 01:32:56 +01:00
vars Let's encript certificate with acme.sh 2017-12-03 01:32:56 +01:00
.gitignore New PHP management 2017-10-26 11:04:38 +02:00
.travis.yml With Vagrant 2.* ansible.sudo -> ansible.become 2017-11-27 13:25:04 +01:00
LICENSE Initial commit 2015-07-15 12:12:06 +02:00
README.md Let's encript certificate with acme.sh 2017-12-03 01:32:56 +01:00
Vagrantfile With Vagrant 2.* ansible.sudo -> ansible.become 2017-11-27 13:25:04 +01:00

README.md

Nginx for Debian/FreeBSD Ansible role

Ansible Galaxy Build Status

Install and configure Nginx on Debian/FreeBSD.

Features:

  • SSL/TLS "hardened" support
  • Manage basic auth on site / location
  • Proxy + Upstream
  • Fast PHP configuration
  • Preconfigured site templates (should work on many app)
  • Auto-configure HTTP2 on SSL/TLS sites
  • Manage dynamic modules (install and loading)
  • Deploy custom facts.d with sites config
  • Can listen with proxy protocol
  • Generate certificates with acme.sh (let's encrypt) -- EXPERIMENTAL

Requirements

None. If you set true to nginx_backports, you must install backports repository before lauching this role.

Role Variables

Packaging

Debian:

  • nginx_apt_package: APT nginx package (try: apt-cache search ^nginx)
  • nginx_backports: Install nginx from backport repository (bool)

FreeBSD:

  • nginx_pkgng_package: PKGNG nginx package (should be "nginx" or "nginx-devel")

Shared

  • 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_resolver: list of DNS resolver (default: OpenDNS)
  • nginx_error_log_level: default log level
  • nginx_auto_config_httpv2: boolean, auto configure HTTP2 where possible
  • nginx_fastcgi_fix_realpath: boolean, use realpath for fastcgi (fix problems with symlinks and PHP opcache)

Nginx Configuration

  • nginx_user
  • nginx_worker_processes
  • nginx_pid: daemon pid file
  • nginx_events_*: all variables in events block
  • nginx_http_*: all variables in http block
  • nginx_custom_http: instructions list (will put data in /etc/nginx/conf.d/custom.conf)
  • nginx_dyn_modules: dynamic module list to load

About modules

Last updates from Debian backports loads modules from /etc/nginx/modules-enabled directory. Disabling/Enabling is not supported anymore. Please wait further update.

Fine configuration

Site configuration

PHP configuration

Upstream Configuration

SSL/TLS Configuration

Basic Auth

FreeBSD

acme.sh

Note

  • Active support for Debian.
  • FreeBSD support is experimental (no Travis). I only test (for the moment) 10.2 (but it can work on other versions).
  • I don't manage BackupPC for FreeBSD (PR welcome).

Dependencies

None

Example Playbook

See tests/test.yml.

License

GPLv2

Author Information