Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding option http_cfg_append to class nginx #96

Merged
merged 2 commits into from
Jul 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
$proxy_cache_inactive = $nginx::params::nx_proxy_cache_inactive,
$proxy_http_version = $nginx::params::nx_proxy_http_version,
$types_hash_max_size = $nginx::params::nx_types_hash_max_size,
$types_hash_bucket_size = $nginx::params::nx_types_hash_bucket_size
$types_hash_bucket_size = $nginx::params::nx_types_hash_bucket_size,
$http_cfg_append = $nginx::params::nx_http_cfg_append
) inherits nginx::params {
File {
owner => 'root',
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$service_restart = $nginx::params::nx_service_restart,
$mail = $nginx::params::nx_mail,
$server_tokens = $nginx::params::nx_server_tokens,
$http_cfg_append = $nginx::params::nx_http_cfg_append,
$nginx_vhosts = {},
$nginx_upstreams = {},
$nginx_locations = {},
Expand All @@ -66,6 +67,7 @@
proxy_cache_inactive => $proxy_cache_inactive,
confd_purge => $confd_purge,
server_tokens => $server_tokens,
http_cfg_append => $http_cfg_append,
require => Class['nginx::package'],
notify => Class['nginx::service'],
}
Expand Down
14 changes: 10 additions & 4 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
$nx_types_hash_bucket_size = 512
$nx_names_hash_bucket_size = 64
$nx_multi_accept = off
$nx_events_use = false # One of [kqueue|rtsig|epoll|/dev/poll|select|poll|eventport] or false to use OS default
# One of [kqueue|rtsig|epoll|/dev/poll|select|poll|eventport]
# or false to use OS default
$nx_events_use = false
$nx_sendfile = on
$nx_keepalive_timeout = 65
$nx_tcp_nodelay = on
Expand Down Expand Up @@ -70,12 +72,16 @@
/(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo)/ => 'nginx',
}

# Service restart after Nginx 0.7.53 could also be just "/path/to/nginx/bin -s HUP"
# Some init scripts do a configtest, some don't. If configtest_enable it's true
# then service restart will take $nx_service_restart value, forcing configtest.
# Service restart after Nginx 0.7.53 could also be just
# "/path/to/nginx/bin -s HUP" Some init scripts do a configtest, some don't.
# If configtest_enable it's true then service restart will take
# $nx_service_restart value, forcing configtest.

$nx_configtest_enable = false
$nx_service_restart = '/etc/init.d/nginx configtest && /etc/init.d/nginx restart'

$nx_mail = false

$nx_http_cfg_append = false

}
10 changes: 8 additions & 2 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,22 @@ http {
keepalive_timeout <%= scope.lookupvar('nginx::params::nx_keepalive_timeout')%>;
tcp_nodelay <%= scope.lookupvar('nginx::params::nx_tcp_nodelay')%>;

<% if scope.lookupvar('nginx::params::nx_gzip') == 'on' %>
<% if scope.lookupvar('nginx::params::nx_gzip') == 'on' %>
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
<% end -%>
<% end -%>

<% if @proxy_cache_path -%>
proxy_cache_path <%= @proxy_cache_path %> levels=<%= @proxy_cache_levels %> keys_zone=<%= @proxy_cache_keys_zone %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %>;
<% end -%>

<% if @http_cfg_append -%><% @http_cfg_append.sort_by{|k,v| k}.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%>
<% end -%>

include /etc/nginx/conf.d/*.conf;

}
<% if scope.lookupvar('nginx::mail') %>
mail {
Expand Down