From f18e83f4b096ba5dbb523eaaf7fb9914d95761f5 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Mon, 13 Apr 2015 14:02:18 -0400 Subject: [PATCH] vhost: simplify maintenance variable code --- templates/vhost/vhost_header.erb | 7 +------ templates/vhost/vhost_ssl_header.erb | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/templates/vhost/vhost_header.erb b/templates/vhost/vhost_header.erb index 3b280be..58a3626 100644 --- a/templates/vhost/vhost_header.erb +++ b/templates/vhost/vhost_header.erb @@ -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; diff --git a/templates/vhost/vhost_ssl_header.erb b/templates/vhost/vhost_ssl_header.erb index 60b4d3b..970e69c 100644 --- a/templates/vhost/vhost_ssl_header.erb +++ b/templates/vhost/vhost_ssl_header.erb @@ -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 -%>