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 additional config to the locations resource and fix set_header in vhost resource #289

Merged
merged 1 commit into from
Apr 9, 2014
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
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