Commit 408c6f314326bbecea9f84a8b3649b6cd9ac4fe7
1 parent
82977500
Bump to v0.4.0. Add attribute to customize port per vhost.
Showing
6 changed files
with
16 additions
and
5 deletions
... | ... | @@ -8,11 +8,11 @@ driver: |
8 | 8 | subnet_id: subnet-d530d8b1 |
9 | 9 | instance_type: t2.micro |
10 | 10 | associate_public_ip: true |
11 | - require_chef_omnibus: true | |
11 | + require_chef_omnibus: 12.12.15 | |
12 | 12 | shared_credentials_profile: earth |
13 | 13 | |
14 | 14 | provisioner: |
15 | - name: chef_solo | |
15 | + name: chef_zero | |
16 | 16 | |
17 | 17 | platforms: |
18 | 18 | - name: ubuntu-14.04 | ... | ... |
... | ... | @@ -44,6 +44,11 @@ default['cfe-nginx-php-fpm']['nginx']['sites'] = [ |
44 | 44 | # |
45 | 45 | #:server_name => 'example.com', |
46 | 46 | |
47 | + # Port number. Default: either '443' or '80', | |
48 | + # depending on whether HTTPS is used or not. | |
49 | + # | |
50 | + #:port => nil, | |
51 | + | |
47 | 52 | # Server aliases in an array. Default: [] |
48 | 53 | # |
49 | 54 | #:aliases => ['www.example.com'], | ... | ... |
... | ... | @@ -4,7 +4,7 @@ maintainer_email 'sysadmin@chromedia.com' |
4 | 4 | license 'Apache License' |
5 | 5 | description 'Simplifies setup of Nginx+PHP-FPM in Chromedia.' |
6 | 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) |
7 | -version '0.3.8' | |
7 | +version '0.4.0' | |
8 | 8 | |
9 | 9 | { |
10 | 10 | 'openssl' => '4.4.0', | ... | ... |
... | ... | @@ -55,6 +55,7 @@ node[cb]['nginx']['sites'].each do |site| |
55 | 55 | |
56 | 56 | # Assign default values to attributes |
57 | 57 | site_index = site[:index] |
58 | + site_port = site[:port] | |
58 | 59 | site_aliases = site[:aliases] || [] |
59 | 60 | site_doc_root = site[:doc_root] |
60 | 61 | site_alo = site[:access_log_options] |
... | ... | @@ -238,6 +239,7 @@ node[cb]['nginx']['sites'].each do |site| |
238 | 239 | notifies :restart, 'service[nginx]', :delayed |
239 | 240 | variables( |
240 | 241 | :server_name => site_sname, |
242 | + :port => site_port, | |
241 | 243 | :aliases => site_aliases, |
242 | 244 | :doc_root => site_doc_root, |
243 | 245 | :index => site_index, | ... | ... |
... | ... | @@ -64,7 +64,7 @@ server { |
64 | 64 | } |
65 | 65 | |
66 | 66 | server { |
67 | - listen 443 ssl; | |
67 | + listen <%= @port || '443' %> ssl; | |
68 | 68 | |
69 | 69 | ssl_certificate <%= @path_crt %>; |
70 | 70 | ssl_certificate_key <%= @path_key %>; |
... | ... | @@ -90,7 +90,7 @@ server { |
90 | 90 | add_header Strict-Transport-Security "<%= hsts %>"; |
91 | 91 | <% else -%> |
92 | 92 | server { |
93 | - listen 80; | |
93 | + listen <%= @port || '80' %>; | |
94 | 94 | |
95 | 95 | <% end -%> |
96 | 96 | <% @add_headers.each do |header, value| -%> | ... | ... |