Skip to content

Commit 19eb28a

Browse files
authored
Merge pull request #2535 from kajinamit/vhost-dirs-sendfile
Add EnableSendfile per directory
2 parents fa92741 + 09d5499 commit 19eb28a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

spec/defines/vhost_spec.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@
139139
{
140140
'enforce' => 'any',
141141
'requires' => ['any-valid1', 'any-valid2']
142-
}
142+
},
143+
'enable_sendfile' => 'On',
143144
},
144145
{
145146
'path' => '*',
@@ -661,6 +662,7 @@
661662
.with_content(%r{^\s+</RequireAny>$})
662663
.with_content(%r{^\s+Require any-valid1$})
663664
.with_content(%r{^\s+Require any-valid2$})
665+
.with_content(%r{^\s+EnableSendfile On$})
664666
.with_content(%r{^\s+LDAPReferrals off$})
665667
.with_content(%r{^\s+ProxyPass http://backend-b/ retry=0 timeout=5 noquery interpolate$})
666668
.with_content(%r{^\s+ProxyPassMatch http://backend-b/ retry=0 timeout=5 noquery interpolate$})

templates/vhost/_directories.erb

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
<%- path = directory['path'] -%>
2020

2121
<<%= provider %> "<%= path %>">
22-
<%- if directory['headers'] -%>
23-
<%- Array(directory['headers']).each do |header| -%>
22+
<%- if directory['enable_sendfile'] -%>
23+
EnableSendfile <%= directory['enable_sendfile'] %>
24+
<%- end -%>
25+
<%- if directory['headers'] -%>
26+
<%- Array(directory['headers']).each do |header| -%>
2427
Header <%= header %>
2528
<%- end -%>
2629
<%- end -%>

0 commit comments

Comments
 (0)