Merge "Add HTTPS for trystack.openstack.org"
This commit is contained in:
commit
dbc824ffc8
@ -316,12 +316,18 @@ class openstack_project::static (
|
|||||||
# Trystack
|
# Trystack
|
||||||
|
|
||||||
::httpd::vhost { 'trystack.openstack.org':
|
::httpd::vhost { 'trystack.openstack.org':
|
||||||
port => 80,
|
port => 443, # Is required despite not being used.
|
||||||
priority => '50',
|
|
||||||
docroot => '/opt/trystack',
|
docroot => '/opt/trystack',
|
||||||
template => 'openstack_project/trystack.vhost.erb',
|
priority => '50',
|
||||||
|
ssl => true,
|
||||||
|
template => 'openstack_project/static-http-and-https.vhost.erb',
|
||||||
|
vhost_name => 'trystack.openstack.org',
|
||||||
serveraliases => ['trystack.org', 'www.trystack.org'],
|
serveraliases => ['trystack.org', 'www.trystack.org'],
|
||||||
require => Vcsrepo['/opt/trystack'],
|
require => [
|
||||||
|
Vcsrepo['/opt/trystack'],
|
||||||
|
File[$cert_file],
|
||||||
|
File[$key_file],
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
vcsrepo { '/opt/trystack':
|
vcsrepo { '/opt/trystack':
|
||||||
|
@ -4,6 +4,15 @@
|
|||||||
|
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName <%= @vhost_name %>
|
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 %>
|
DocumentRoot <%= @docroot %>
|
||||||
<Directory <%= @docroot %>>
|
<Directory <%= @docroot %>>
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
|
@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName <%= @vhost_name %>
|
ServerName <%= @vhost_name %>
|
||||||
|
<% if @serveraliases.is_a? Array -%>
|
||||||
|
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
||||||
|
<% elsif @serveraliases != '' -%>
|
||||||
|
<%= " ServerAlias #{@serveraliases}" %>
|
||||||
|
<% end -%>
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
RewriteRule ^/(.*) https://<%= @vhost_name %>/$1 [last,redirect=permanent]
|
RewriteRule ^/(.*) https://<%= @vhost_name %>/$1 [last,redirect=permanent]
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
# ************************************
|
|
||||||
# Managed by Puppet
|
|
||||||
# ************************************
|
|
||||||
|
|
||||||
NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
|
||||||
<VirtualHost <%= @vhost_name %>:<%= @port %>>
|
|
||||||
ServerName <%= @srvname %>
|
|
||||||
<% if @serveraliases.is_a? Array -%>
|
|
||||||
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
|
||||||
<% elsif @serveraliases != '' -%>
|
|
||||||
<%= " ServerAlias #{@serveraliases}" %>
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
# NOTE(pabelanger): Rewrite any valid serveraliases to srvname.
|
|
||||||
RewriteEngine On
|
|
||||||
RewriteCond %{HTTP_HOST} !<%= @srvname %>$ [NC]
|
|
||||||
RewriteRule ^/(.*)$ http://<%= @srvname %>/$1 [L,R=301]
|
|
||||||
|
|
||||||
DocumentRoot <%= @docroot %>
|
|
||||||
<Directory <%= @docroot %>>
|
|
||||||
Options <%= @options %>
|
|
||||||
AllowOverride None
|
|
||||||
Order allow,deny
|
|
||||||
allow from all
|
|
||||||
Satisfy Any
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
ErrorLog /var/log/apache2/<%= @name %>_error.log
|
|
||||||
LogLevel warn
|
|
||||||
CustomLog /var/log/apache2/<%= @name %>_access.log combined
|
|
||||||
ServerSignature Off
|
|
||||||
</VirtualHost>
|
|
Loading…
x
Reference in New Issue
Block a user