Permalink
Browse files

Fixed nginx defaults order

  • Loading branch information...
ajgon committed Apr 26, 2016
1 parent bf843aa commit af560db6280405dee15029af3f6290f8ba76a853
View
@@ -46,21 +46,21 @@
# webserver
## common
default['nginx']['default_site_enabled'] = false
default['defaults']['webserver']['adapter'] = 'nginx'
default['defaults']['webserver']['ssl_for_legacy_browsers'] = false
## nginx
default['nginx']['default_site_enabled'] = false
default['defaults']['webserver']['build_type'] = 'default'
default['defaults']['webserver']['client_body_timeout'] = '12'
default['defaults']['webserver']['client_header_timeout'] = '12'
default['defaults']['webserver']['client_max_body_size'] = '10m'
default['defaults']['webserver']['keepalive_timeout'] = '15'
default['defaults']['webserver']['log_dir'] = '/var/log/nginx'
default['defaults']['webserver']['proxy_read_timeout'] = '60'
default['defaults']['webserver']['proxy_send_timeout'] = '60'
default['defaults']['webserver']['send_timeout'] = '10'
default['nginx']['client_body_timeout'] = default['defaults']['webserver']['client_body_timeout'] = '12'
default['nginx']['client_header_timeout'] = default['defaults']['webserver']['client_header_timeout'] = '12'
default['nginx']['client_max_body_size'] = default['defaults']['webserver']['client_max_body_size'] = '10m'
default['nginx']['keepalive_timeout'] = default['defaults']['webserver']['keepalive_timeout'] = '15'
default['nginx']['log_dir'] = default['defaults']['webserver']['log_dir'] = '/var/log/nginx'
default['nginx']['proxy_read_timeout'] = default['defaults']['webserver']['proxy_read_timeout'] = '60'
default['nginx']['proxy_send_timeout'] = default['defaults']['webserver']['proxy_send_timeout'] = '60'
default['nginx']['send_timeout'] = default['defaults']['webserver']['send_timeout'] = '10'
# framework
## common
@@ -11,6 +11,12 @@ class Nginx < Drivers::Webserver::Base
notifies :deploy, action: :reload, resource: 'service[nginx]', timer: :delayed
notifies :undeploy, action: :reload, resource: 'service[nginx]', timer: :delayed
def raw_out
node['defaults']['webserver'].merge(node['nginx']).merge(
node['deploy'][app['shortname']]['webserver'] || {}
).symbolize_keys
end
def setup(context)
node.default['nginx']['install_method'] = out[:build_type].to_s == 'source' ? 'source' : 'package'
recipe = out[:build_type].to_s == 'source' ? 'source' : 'default'
View
@@ -6,7 +6,8 @@ def node(override = {})
codename: 'trusty'
},
nginx: {
version: '1.4.6'
version: '1.4.6',
client_body_timeout: '30'
},
deploy: {
dummy_project: {
@@ -13,6 +13,7 @@
it 'returns proper out data' do
expect(described_class.new(aws_opsworks_app, node).out).to eq(
client_max_body_size: '125m',
client_body_timeout: '30',
dhparams: '--- DH PARAMS ---',
keepalive_timeout: '15'
)
@@ -96,6 +96,9 @@
expect(chef_run)
.to render_file("/etc/nginx/sites-available/#{aws_opsworks_app['shortname']}")
.with_content('client_max_body_size 125m;')
expect(chef_run)
.to render_file("/etc/nginx/sites-available/#{aws_opsworks_app['shortname']}")
.with_content('client_body_timeout 30;')
expect(chef_run)
.to render_file("/etc/nginx/sites-available/#{aws_opsworks_app['shortname']}")
.with_content('keepalive_timeout 15;')

0 comments on commit af560db

Please sign in to comment.