7be12d0870
- added raw_prepend / raw_append to vhosts & locations, which adds raw lines to the vhost/location /without/ semicolons - added location_raw_prepend / location_raw_append to vhost for passing through to default location - added spec tests for new parameters - cleaned up location specs to match new header/body/footer setup reducing duplicate checks by testing header/footer separately. - cleaned up whitespace (2 space) in touched files - used `<%-` in erb templates to allow the use of leading whitespace, making the logic flow more readable - Also adds spec tests for recent vhost updates: - client_body_timeout - client_header_timeout - gzip_types - testing that the first server_name is used when www_to_non_www is true
39 lines
1.1 KiB
Text
39 lines
1.1 KiB
Text
<% if @include_files %>
|
|
<%- @include_files.each do |file| -%>
|
|
include <%= file %>;
|
|
<%- end -%>
|
|
<% end -%>
|
|
<% if @vhost_cfg_append -%>
|
|
<%- @vhost_cfg_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
|
|
<%- if value.is_a?(Hash) -%>
|
|
<%- value.each do |subkey,subvalue| -%>
|
|
<%- Array(subvalue).each do |asubvalue| -%>
|
|
<%= key %> <%= subkey %> <%= asubvalue %>;
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- else -%>
|
|
<%- Array(value).each do |asubvalue| -%>
|
|
<%= key %> <%= asubvalue %>;
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<% end -%>
|
|
<% if @vhost_cfg_ssl_append -%>
|
|
<%- @vhost_cfg_ssl_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
|
|
<%- if value.is_a?(Hash) -%>
|
|
<%- value.each do |subkey,subvalue| -%>
|
|
<%- Array(subvalue).each do |asubvalue| -%>
|
|
<%= key %> <%= subkey %> <%= asubvalue %>;
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- else -%>
|
|
<%- Array(value).each do |asubvalue| -%>
|
|
<%= key %> <%= asubvalue %>;
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<%- end -%>
|
|
<% end -%>
|
|
<% Array(@raw_append).each do |line| -%>
|
|
<%= line %>
|
|
<% end -%>
|
|
}
|