Skip to content

Commit

Permalink
Adding fastcgi_index support
Browse files Browse the repository at this point in the history
  • Loading branch information
elmobp committed Apr 11, 2017
1 parent 818838d commit 57a8cba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions manifests/resource/server.pp
Expand Up @@ -46,6 +46,7 @@
# [*resolver*] - Array: Configures name servers used to resolve
# names of upstream servers into addresses.
# [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_index*] - FastCGI index page
# [*fastcgi_param*] - Set additional custom fastcgi_params
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
# [*fastcgi_script*] - optional SCRIPT_FILE parameter
Expand Down Expand Up @@ -254,6 +255,7 @@
Optional[String] $proxy_buffering = undef,
Array $resolver = [],
Optional[String] $fastcgi = undef,
Optional[String] $fastcgi_index = undef,
$fastcgi_param = undef,
String $fastcgi_params = "${::nginx::conf_dir}/fastcgi_params",
Optional[String] $fastcgi_script = undef,
Expand Down Expand Up @@ -405,6 +407,7 @@
proxy_set_body => $proxy_set_body,
proxy_buffering => $proxy_buffering,
fastcgi => $fastcgi,
fastcgi_index => $fastcgi_index,
fastcgi_param => $fastcgi_param,
fastcgi_params => $fastcgi_params,
fastcgi_script => $fastcgi_script,
Expand Down
11 changes: 10 additions & 1 deletion spec/defines/resource_server_spec.rb
Expand Up @@ -9,7 +9,8 @@
{
www_root: '/',
ipv6_enable: true,
listen_unix_socket_enable: true
listen_unix_socket_enable: true,
fastcgi_index: 'index.php'
}
end

Expand Down Expand Up @@ -974,6 +975,14 @@
it { is_expected.to contain_file('/etc/nginx/fastcgi_params').with_mode('0644') }
end

context 'when fastcgi_index => "index.php"' do
let :params do
default_params.merge(fastcgi_index: 'index.php')
end

it { is_expected.to contain_nginx__resource__location("#{title}-default").with_fastcgi_index('index.php') }
end

context 'when fastcgi_param => {key => value}' do
let :params do
default_params.merge(fastcgi_param: { 'key' => 'value' })
Expand Down

0 comments on commit 57a8cba

Please sign in to comment.