Skip to content

Commit

Permalink
Merge pull request voxpupuli#289 from b4ldr/master
Browse files Browse the repository at this point in the history
Add additional config to the locations resource and fix set_header in vhost resource
  • Loading branch information
James Fryman committed Apr 9, 2014
2 parents a62ec20 + 56c3ff6 commit 49ae06e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
# [*proxy*] - Proxy server(s) for a location to connect to.
# Accepts a single value, can be used in conjunction with
# nginx::resource::upstream
# [*proxy_redirect*] - sets the text, which must be changed in
# response-header "Location" and "Refresh" in the response of the proxied
# server.
# [*proxy_read_timeout*] - Override the default the proxy read timeout
# value of 90 seconds
# [*proxy_connect_timeout*] - Override the default the proxy connect timeout
# value of 90 seconds
# [*proxy_set_header*] - Array of vhost headers to set
# [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
# [*fastcgi_script*] - optional SCRIPT_FILE parameter
Expand Down Expand Up @@ -105,7 +111,10 @@
'index.htm',
'index.php'],
$proxy = undef,
$proxy_redirect = $nginx::params::nx_proxy_redirect,
$proxy_read_timeout = $nginx::params::nx_proxy_read_timeout,
$proxy_connect_timeout = $nginx::params::nx_proxy_connect_timeout,
$proxy_set_header = $nginx::params::nx_proxy_set_header,
$fastcgi = undef,
$fastcgi_params = '/etc/nginx/fastcgi_params',
$fastcgi_script = undef,
Expand Down Expand Up @@ -155,7 +164,10 @@
if ($proxy != undef) {
validate_string($proxy)
}
validate_string($proxy_redirect)
validate_string($proxy_read_timeout)
validate_string($proxy_connect_timeout)
validate_array($proxy_set_header)
if ($fastcgi != undef) {
validate_string($fastcgi)
}
Expand Down
5 changes: 5 additions & 0 deletions templates/vhost/vhost_location_proxy.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<% end -%>
proxy_pass <%= @proxy %>;
proxy_read_timeout <%= @proxy_read_timeout %>;
proxy_connect_timeout <%= @proxy_connect_timeout %>;
proxy_redirect <%= @proxy_redirect %>;
<% @proxy_set_header.each do |header| -%>
proxy_set_header <%= header %>;
<% end -%>
<% if @proxy_method -%>
proxy_method <%= @proxy_method %>;
<% end -%>
Expand Down

0 comments on commit 49ae06e

Please sign in to comment.