Skip to content

Commit

Permalink
Merge pull request #606 from 3flex/602-fix-redundant-code
Browse files Browse the repository at this point in the history
vhost: simplify maintenance variable code
  • Loading branch information
3flex committed Apr 14, 2015
2 parents c54359f + f18e83f commit 143e840
Show file tree
Hide file tree
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
Expand Up @@ -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;
Expand Down
7 changes: 1 addition & 6 deletions templates/vhost/vhost_ssl_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>
Expand Down

0 comments on commit 143e840

Please sign in to comment.