Skip to content

Commit 09d5499

Browse files
committed
Add EnableSendfile per directory
The EnableSendfile option can be configured in a Directory directive to disable/enable the snedfile feature for specific paths.
1 parent 1756ce0 commit 09d5499

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' => '*',
@@ -641,6 +642,7 @@
641642
.with_content(%r{^\s+</RequireAny>$})
642643
.with_content(%r{^\s+Require any-valid1$})
643644
.with_content(%r{^\s+Require any-valid2$})
645+
.with_content(%r{^\s+EnableSendfile On$})
644646
.with_content(%r{^\s+LDAPReferrals off$})
645647
.with_content(%r{^\s+ProxyPass http://backend-b/ retry=0 timeout=5 noquery interpolate$})
646648
.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)