diff --git a/manifests/resource/server.pp b/manifests/resource/server.pp index 4a2c6d297..7ab7c8316 100644 --- a/manifests/resource/server.pp +++ b/manifests/resource/server.pp @@ -31,6 +31,7 @@ # [*fastcgi*] - location of fastcgi (host:port) # [*fastcgi_param*] - Set additional custom fastcgi_params # [*fastcgi_params*] - optional alternative fastcgi_params file to use +# [*fastcgi_index*] - optional FastCGI index page # [*fastcgi_script*] - optional SCRIPT_FILE parameter # [*uwsgi_read_timeout*] - optional value for uwsgi_read_timeout # [*ssl*] - Indicates whether to setup SSL bindings for this server. @@ -120,6 +121,7 @@ # [*maintenance_value*] - Value to return when maintenance is on. Default to return 503 # [*error_pages*] - Hash: setup errors pages, hash key is the http code and hash value the page # [*locations*] - Hash of servers resources used by this server + # Actions: # # Requires: @@ -191,6 +193,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, @@ -342,6 +345,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, diff --git a/spec/defines/resource_server_spec.rb b/spec/defines/resource_server_spec.rb index 5c55722a7..ac1187cb7 100644 --- a/spec/defines/resource_server_spec.rb +++ b/spec/defines/resource_server_spec.rb @@ -9,7 +9,8 @@ { www_root: '/', ipv6_enable: true, - listen_unix_socket_enable: true + listen_unix_socket_enable: true, + fastcgi_index: 'index.php' } end @@ -986,6 +987,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' })