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

Add use_temp_path into proxy_cache_path #841

Merged
merged 1 commit into from
Jul 29, 2016
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
5 changes: 5 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
$proxy_cache_levels = '1',
$proxy_cache_max_size = '500m',
$proxy_cache_path = false,
$proxy_use_temp_path = false,
$proxy_connect_timeout = '90',
$proxy_headers_hash_bucket_size = '64',
$proxy_http_version = undef,
Expand Down Expand Up @@ -143,6 +144,10 @@
validate_string($proxy_cache_max_size)
validate_string($proxy_cache_inactive)

if ($proxy_use_temp_path != false) {
validate_re($proxy_use_temp_path, '^(on|off)$')
}

if ($fastcgi_cache_path != false) {
validate_string($fastcgi_cache_path)
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
$proxy_cache_levels = undef,
$proxy_cache_max_size = undef,
$proxy_cache_path = undef,
$proxy_use_temp_path = undef,
$proxy_connect_timeout = undef,
$proxy_headers_hash_bucket_size = undef,
$proxy_http_version = undef,
Expand Down Expand Up @@ -178,6 +179,7 @@
$proxy_cache_levels or
$proxy_cache_max_size or
$proxy_cache_path or
$proxy_use_temp_path or
$proxy_conf_template or
$proxy_connect_timeout or
$proxy_headers_hash_bucket_size or
Expand Down Expand Up @@ -260,6 +262,7 @@
proxy_cache_levels => $proxy_cache_levels,
proxy_cache_max_size => $proxy_cache_max_size,
proxy_cache_path => $proxy_cache_path,
proxy_use_temp_path => $proxy_use_temp_path,
proxy_conf_template => $proxy_conf_template,
proxy_connect_timeout => $proxy_connect_timeout,
proxy_headers_hash_bucket_size => $proxy_headers_hash_bucket_size,
Expand Down
4 changes: 2 additions & 2 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ http {
<% end -%>
<% if @proxy_cache_path.is_a?(Hash) -%>
<% @proxy_cache_path.sort_by{|k,v| k}.each do |key,value| -%>
proxy_cache_path <%= key %> keys_zone=<%= value %> levels=<%= @proxy_cache_levels %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %>;
proxy_cache_path <%= key %> keys_zone=<%= value %> levels=<%= @proxy_cache_levels %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %><% if @proxy_use_temp_path %> use_temp_path=<%= @proxy_use_temp_path %><% end -%>;
<% end -%>
<% elsif @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 %>;
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 %><% if @proxy_use_temp_path %> use_temp_path=<%= @proxy_use_temp_path %><% end %>;
<% end -%>
<% if @fastcgi_cache_path -%>
fastcgi_cache_path <%= @fastcgi_cache_path %> levels=<%= @fastcgi_cache_levels %> keys_zone=<%= @fastcgi_cache_keys_zone %> max_size=<%= @fastcgi_cache_max_size %> inactive=<%= @fastcgi_cache_inactive %>;
Expand Down