Name: ansible-nginx-unicorn
Owner: Simpleweb
Description: Nginx installation with Unicorn integration
Forked from: agios/ansible-nginx-unicorn
Created: 2015-06-01 12:52:11.0
Updated: 2014-11-23 23:03:45.0
Pushed: 2015-06-23 14:38:34.0
Homepage: null
Size: 127
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This Ansible role installs Nginx and generates configuration for Unicorn applications
None
This role does not install or configure Unicorn itself. It is designed to play nicely with a Unicorn role such as Unicorn-RVM.
nginx_sites
is an array of unicorn sites, defaults to []
Each nginx_sites entry is a dict with the following options:
name
(eg my_app
, required)server_name
(eg my-app.my-domain.org
, required, in any
format supported by nginx)root
defaults to /var/www/{{ name }}/current
(Capistrano
compatible)listen
defaults to [::]:80
(Both IPv4 and IPv6)access_log
is a dict with the following options:path
defaults to /var/log/nginx/{{ name }}.access.log
format
is optional, can be used to specify a custom nginx
log output formaterror_log
see abovessl
if this option is given, an ssl config section will be
generated. It contains the following options:certificate
required, path to ssl certificatecertificate_key
required, path to ssl certificate keyssl_only
if set to true
, always redirect to sslspdy
if set to true
, enable spdy supportsensitive_uris
required unless ssl_only
, nginx uri
expressions that will be served using httpsaccess_log
as above, for https requestserror_log
as above, for https requestsThe role could be included in a playbook as follows (unicorn-rvm also shown):
ts: application
les:
- role: unicorn-rvm
rails_apps:
- { name: 'my_app1', ruby_version: 'ruby-1.9.3' }
- { name: 'my_app2', ruby_version: 'ruby-2.1.1', root: '/var/test_apps/app2', env: staging }
- role: nginx-unicorn
nginx_sites:
- name: 'my_app1'
server_name: 'my-app1.example.com'
access_log:
format: 'main'
ssl:
certificate: /etc/ssl/localcerts/my_app1.pem
certificate_key: /etc/ssl/localcerts/my_app1.key
sensitive_uris:
- ^/user/sign_in(.*)
- ^/user/password(.*)
access_log:
format: 'main'
- name: 'my_app2'
server_name: 'my-app2.example.com *.mydomain.com'
root: '/var/test_apps/app2'
ssl:
certificate: /etc/ssl/localcerts/my_app2.crt
certificate_key: /etc/ssl/localcerts/my_app2.key
ssl_only: true
MIT