From c95d0e59e0e88aeab940d967840abe63e5438c50 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 7 Dec 2016 20:09:46 +0000 Subject: [PATCH] Redirect to HTTPS for governance.openstack.org Unilaterally redirect any plain HTTP requests for the governance.openstack.org site to HTTPS by making the static-governance vhost template's *:80 VirtualHost block match the one we use for our generic https-redirect vhost template. Change-Id: I2f63314f505d2fa03764b9b3cfc53d1070372e7c --- .../templates/static-governance.vhost.erb | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/modules/openstack_project/templates/static-governance.vhost.erb b/modules/openstack_project/templates/static-governance.vhost.erb index 9e75006b2f..dc3cfa1cd0 100644 --- a/modules/openstack_project/templates/static-governance.vhost.erb +++ b/modules/openstack_project/templates/static-governance.vhost.erb @@ -5,39 +5,12 @@ ServerName <%= @vhost_name %> <% if @serveraliases.is_a? Array -%> - # Permanently redirect these ServerAlias entries to ServerName <% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%> <% elsif @serveraliases != '' -%> <%= " ServerAlias #{@serveraliases}" %> - RewriteEngine On - RewriteCond %{HTTP_HOST} !<%= @vhost_name %>$ [NC] - RewriteRule ^/(.*)$ http://<%= @vhost_name %>/$1 [L,R=301] <% end -%> - DocumentRoot <%= @docroot %> - - # Alias other folders - <% scope.lookupvar('openstack_project::static::governance_aliases').each do |a, d| -%> - Alias "<%= a %>" "<%= d %>" - <% end -%> - <% scope.lookupvar('openstack_project::static::governance_directories').each do |dirname| -%> - > - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Satisfy Any - Require all granted - - <% end -%> - - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Satisfy Any - Require all granted - - Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform" - Header set Pragma "no-cache" - - ErrorDocument 404 /badges/project-unofficial.svg - + RewriteEngine On + RewriteRule ^/(.*) https://<%= @vhost_name %>/$1 [last,redirect=permanent] LogLevel warn ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log CustomLog /var/log/apache2/<%= @vhost_name %>_access.log combined