Skip to content

Commit e07baba

Browse files
committed
Add possibility for custom uwsgi_param to default vhost in server resource.
1 parent 6d8c265 commit e07baba

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

manifests/resource/server.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
# optional FastCGI index page
8080
# @param fastcgi_script
8181
# optional SCRIPT_FILE parameter
82+
# @param uwsgi_param
83+
# Set additional custom uwsgi parameters (uwsgi_param in nginx) in the default vhost.
8284
# @param uwsgi_read_timeout
8385
# optional value for uwsgi_read_timeout
8486
# @param ssl
@@ -360,6 +362,7 @@
360362
String $fastcgi_params = "${nginx::conf_dir}/fastcgi.conf",
361363
Optional[String] $fastcgi_script = undef,
362364
Optional[String] $uwsgi = undef,
365+
Optional[Hash] $uwsgi_param = undef,
363366
String $uwsgi_params = "${nginx::config::conf_dir}/uwsgi_params",
364367
Optional[String] $uwsgi_read_timeout = undef,
365368
Array $index_files = [
@@ -545,6 +548,7 @@
545548
fastcgi_params => $fastcgi_params,
546549
fastcgi_script => $fastcgi_script,
547550
uwsgi => $uwsgi,
551+
uwsgi_param => $uwsgi_param,
548552
uwsgi_params => $uwsgi_params,
549553
uwsgi_read_timeout => $uwsgi_read_timeout,
550554
try_files => $try_files,

spec/defines/resource_server_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,18 @@
14631463
it { is_expected.not_to contain_file('/etc/nginx/bogusparams') }
14641464
end
14651465

1466+
context 'when uwsgi_param has custom params' do
1467+
let :params do
1468+
default_params.merge(
1469+
uwsgi_param: {
1470+
'X-Custom-Param': 'Someting',
1471+
}
1472+
)
1473+
end
1474+
1475+
it { is_expected.to contain_nginx__resource__location("#{title}-default").with_uwsgi_param('X-Custom-Param' => 'Someting') }
1476+
end
1477+
14661478
context 'when listen_port == ssl_port but ssl = false' do
14671479
let :params do
14681480
default_params.merge(listen_port: 80,

0 commit comments

Comments
 (0)