Skip to content

Commit

Permalink
Merge pull request #362 from eholzbach/master
Browse files Browse the repository at this point in the history
allows setting client_body/header_timeout and gzip_types on vhosts
  • Loading branch information
James Fryman committed Jun 26, 2014
2 parents a861f23 + 7a91ff4 commit 2079706
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
# [*auth_basic_user_file*] - This directive sets the htpasswd filename for
# the authentication realm.
# [*client_max_body_size*] - This directive sets client_max_body_size.
# [*client_body_timeout*] - Sets how long the server will wait for a
# client body. Default is 60s
# [*client_header_timeout*] - Sets how long the server will wait for a
# client header. Default is 60s
# [*vhost_cfg_append*] - It expects a hash with custom directives to
# put after everything else inside vhost
# [*vhost_cfg_prepend*] - It expects a hash with custom directives to
Expand All @@ -113,6 +117,7 @@
# [*log_by_lua_file*] - Equivalent to log_by_lua, except that the file
# specified by <path-to-lua-script-file> contains the Lua code, or, as from
# the v0.5.0rc32 release, the Lua/LuaJIT bytecode to be executed.
# [*gzip_types*] - Defines gzip_types, nginx default is text/html
# Actions:
#
# Requires:
Expand Down Expand Up @@ -182,6 +187,8 @@
$try_files = undef,
$auth_basic = undef,
$auth_basic_user_file = undef,
$client_body_timeout = undef,
$client_header_timeout = undef,
$client_max_body_size = undef,
$vhost_cfg_prepend = undef,
$vhost_cfg_append = undef,
Expand All @@ -198,6 +205,7 @@
$rewrite_rules = [],
$string_mappings = {},
$geo_mappings = {},
$gzip_types = undef,
) {

validate_re($ensure, '^(present|absent)$',
Expand Down Expand Up @@ -335,6 +343,15 @@
if ($log_by_lua_file != undef) {
validate_string($log_by_lua_file)
}
if ($client_body_timeout != undef) {
validate_string($client_body_timeout)
}
if ($client_header_timeout != undef) {
validate_string($client_header_timeout)
}
if ($gzip_types != undef) {
validate_string($gzip_types)
}
validate_bool($use_default_location)
validate_array($rewrite_rules)
validate_hash($string_mappings)
Expand Down
9 changes: 9 additions & 0 deletions templates/vhost/vhost_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@ server {
<% if defined? @auth_basic_user_file -%>
auth_basic_user_file <%= @auth_basic_user_file %>;
<% end -%>
<% if defined? @client_body_timeout -%>
client_body_timeout <%= @client_body_timeout %>;
<% end -%>
<% if defined? @client_header_timeout -%>
client_header_timeout <%= @client_header_timeout %>;
<% end -%>
<% if defined? @client_max_body_size -%>
client_max_body_size <%= @client_max_body_size %>;
<% end -%>
<% if defined? @gzip_types -%>
gzip_types <%= @gzip_types %>;
<% end -%>
<%# make sure that allow comes before deny by forcing the allow key (if it -%>
<%# exists) to be first in the output order. The hash keys also need to be -%>
<%# sorted so that the ordering is stable. -%>
Expand Down
9 changes: 9 additions & 0 deletions templates/vhost/vhost_ssl_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,18 @@ server {
<% if defined? @auth_basic_user_file -%>
auth_basic_user_file "<%= @auth_basic_user_file %>";
<% end -%>
<% if defined? @client_body_timeout -%>
client_body_timeout <%= @client_body_timeout %>;
<% end -%>
<% if defined? @client_header_timeout -%>
client_header_timeout <%= @client_header_timeout %>;
<% end -%>
<% if defined? @client_max_body_size -%>
client_max_body_size <%= @client_max_body_size %>;
<% end -%>
<% if defined? @gzip_types -%>
gzip_types <%= @gzip_types %>;
<% end -%>
<% if @index_files.count > 0 -%>
index <% Array(@index_files).each do |i| %> <%= i %><% end %>;
<% end -%>
Expand Down

0 comments on commit 2079706

Please sign in to comment.