Skip to content

Commit

Permalink
Add more per-location proxy options: proxy_send_timeout, proxy_ignore…
Browse files Browse the repository at this point in the history
…_headers and proxy_next_upstream
  • Loading branch information
merclangrat committed Jan 10, 2018
1 parent 6680341 commit c16148f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
],
Array $proxy_hide_header = [],
Array $proxy_pass_header = [],
Array $proxy_ignore_header = [],
$sendfile = 'on',
String $server_tokens = 'on',
$spdy = 'off',
Expand Down
7 changes: 7 additions & 0 deletions manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
# value of 90 seconds
# [*proxy_connect_timeout*] - Override the default the proxy connect timeout
# value of 90 seconds
# [*proxy_send_timeout*] - Override the default the proxy send timeout
# value of 90 seconds
# [*proxy_set_header*] - Array of server headers to set
# [*proxy_hide_header*] - Array of server headers to hide
# [*proxy_pass_header*] - Array of server headers to pass
# [*proxy_ignore_header*] - Array of server headers to ignore
# [*proxy_next_upstream*] - Specify cases a request should be passed to the next server in the upstream.
# [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_param*] - Set additional custom fastcgi_params
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
Expand Down Expand Up @@ -170,9 +174,12 @@
Optional[String] $proxy_redirect = $::nginx::proxy_redirect,
String $proxy_read_timeout = $::nginx::proxy_read_timeout,
String $proxy_connect_timeout = $::nginx::proxy_connect_timeout,
String $proxy_send_timeout = $::nginx::proxy_send_timeout,
Array $proxy_set_header = $::nginx::proxy_set_header,
Array $proxy_hide_header = $::nginx::proxy_hide_header,
Array $proxy_pass_header = $::nginx::proxy_pass_header,
Array $proxy_ignore_header = $::nginx::proxy_ignore_header,
Optional[String] $proxy_next_upstream = undef,
Optional[String] $fastcgi = undef,
Optional[String] $fastcgi_index = undef,
Optional[Hash] $fastcgi_param = undef,
Expand Down
9 changes: 9 additions & 0 deletions templates/server/locations/proxy.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
proxy_connect_timeout <%= @proxy_connect_timeout %>;
proxy_send_timeout <%= @proxy_send_timeout %>;
<% if @proxy_redirect -%>
proxy_redirect <%= @proxy_redirect %>;
<% end -%>
Expand All @@ -27,6 +28,11 @@
proxy_hide_header <%= header %>;
<%- end -%>
<% end -%>
<% unless @proxy_ignore_header.nil? -%>
<%- @proxy_ignore_header.each do |header| -%>
proxy_ignore_headers <%= header %>;
<%- end -%>
<% end -%>
<% unless @proxy_pass_header.nil? -%>
<%- @proxy_pass_header.each do |header| -%>
proxy_pass_header <%= header %>;
Expand Down Expand Up @@ -54,4 +60,7 @@
<% if @proxy_cache_lock -%>
proxy_cache_lock <%= @proxy_cache_lock %>;
<% end -%>
<% if @proxy_next_upstream -%>
proxy_next_upstream <%= @proxy_next_upstream %>;
<% end -%>
<% end -%>

0 comments on commit c16148f

Please sign in to comment.