vhost: simplify maintenance variable code

This commit is contained in:
Matthew Haughton 2015-04-13 14:02:18 -04:00 committed by Matthew Haughton
parent c54359f5fe
commit f18e83f4b0
2 changed files with 2 additions and 12 deletions

View file

@ -103,13 +103,8 @@ server {
<%- end -%>
<% end -%>
<% if @maintenance -%>
set $maintenance "on";
<% else -%>
set $maintenance "off";
<%= @maintenance_value %>;
<% end -%>
if ($maintenance = "on") {
<%= @maintenance_value %>;
}
<% if @rewrite_to_https -%>
if ($ssl_protocol = "") {
return 301 https://$host<% if @ssl_port.to_i != 443 %>:<%= @ssl_port %><% end %>$request_uri;

View file

@ -77,13 +77,8 @@ server {
<% end -%>
<% if @maintenance -%>
set $maintenance "on";
<% else -%>
set $maintenance "off";
<%= @maintenance_value %>;
<% end -%>
if ($maintenance = "on") {
<%= @maintenance_value %>;
}
<% if Array(@resolver).count > 0 -%>
resolver <% Array(@resolver).each do |r| %> <%= r %><% end %>;
<% end -%>