diff --git a/manifests/config.pp b/manifests/config.pp index 5f80ecd..cdb989a 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -43,6 +43,8 @@ class nginx::config( ### END Module/App Configuration ### ### START Nginx Configuration ### + $accept_mutex = 'on', + $accept_mutex_delay = '500ms', $client_body_buffer_size = '128k', $client_max_body_size = '10m', $events_use = false, diff --git a/spec/classes/config_spec.rb b/spec/classes/config_spec.rb index b1d775f..2207b79 100644 --- a/spec/classes/config_spec.rb +++ b/spec/classes/config_spec.rb @@ -124,6 +124,24 @@ describe 'nginx::config' do :value => false, :notmatch => /pid/, }, + { + :title => 'should set accept_mutex on', + :attr => 'accept_mutex', + :value => 'on', + :match => ' accept_mutex on;', + }, + { + :title => 'should set accept_mutex off', + :attr => 'accept_mutex', + :value => 'off', + :match => ' accept_mutex off;', + }, + { + :title => 'should set accept_mutex_delay', + :attr => 'accept_mutex_delay', + :value => '500s', + :match => ' accept_mutex_delay 500s;', + }, { :title => 'should set worker_connections', :attr => 'worker_connections', diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index f239d9f..06b8f2f 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -22,6 +22,10 @@ error_log <%= @nginx_error_log %> <%= @nginx_error_log_severity %>; <% end -%> events { + accept_mutex <%= @accept_mutex %>; + <%- if @accept_mutex_delay -%> + accept_mutex_delay <%= @accept_mutex_delay %>; + <%- end -%> worker_connections <%= @worker_connections -%>; <%- if @multi_accept == 'on' -%> multi_accept on;