FloeDesignTechnologies / ansible-nginx-drupal

Ansible role to configure Nginx for running Drupal using perusio's configuration
Apache License 2.0
22 stars 12 forks source link

Nginx Drupal

Ansible role to configure Nginx for running Drupal using perusio's configuration.

This role only configure Nginx to run Drupal sites, it will not install PHP, Nginx, Drupal, MySQL, etc. It will however, override the entire content of the Nginx configuration directory. You can still add file to the Nginx configuration directory after this role.

Requirements

Role Variables

The following variables are available to configure the role:

Examples

Two Drupal 7 sites, one available in HTTP and HTTPS. The other only available in HTTPS but disabled.

- hosts: all
  roles:
  - role: nginx-drupal
    nginx_drupal_sites:
      - file_name: foo
        server_name: foo.org
        alternate_server_name: www.foo.org
        root: /var/www/foo
        http:
          port: 80
        https:
          port: 443
          certificate: /etc/nginx/ssl/foo.cert
          certificate_key: /etc/nginx/ssl/foo.key
      - file_name: bar
        server_name: bar.org
        alternate_server_name: www.bar.org
        root: /var/www/bar
        enabled: false
        https:
          port: 443
          certificate: /etc/nginx/ssl/bar.cert
          certificate_key: /etc/nginx/ssl/bar.key

Nginx as a Reverse Proxy for a single Drupal 6 sites, without microcaching, with image hot linking protection and a rewrite directive.

- hosts: all
  roles:
  - role: nginx-drupal
    nginx_drupal_git:
      version: D6
    nginx_drupal_hotlinking_protection: true
    nginx_drupal_php_handling: proxy
    nginx_drupal_microcache: false
    nginx_drupal_sites:
      - file_name: foo
        server_name: foo.org
        alternate_server_name: www.foo.org
        root: /var/www/foo
        http:
          port: 80
        rewrites:
         - regex: '^/foo-bar.htm$'
           replacement: '/foo/bar'
           flags: 'permanent'

License

Apache v2

Author Information

Pierre Buyle buyle@pheromone.ca