Skip to content

Commit

Permalink
vhost: simplify maintenance variable code
Browse files Browse the repository at this point in the history
3flex authored and Matthew Haughton committed Apr 14, 2015

Verified

This commit was signed with the committer’s verified signature.
alexanderzobnin Alexander Zobnin
1 parent cff1c04 commit 5aad271
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions templates/vhost/vhost_header.erb
Original file line number Diff line number Diff line change
@@ -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;
7 changes: 1 addition & 6 deletions templates/vhost/vhost_ssl_header.erb
Original file line number Diff line number Diff line change
@@ -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 -%>

0 comments on commit 5aad271

Please sign in to comment.