cookbook-openstack-dashboard/templates/default/dash-site.erb

86 lines
3.6 KiB
Plaintext

<%= node["openstack"]["dashboard"]["custom_template_banner"] %>
<% unless node['apache']['listen_ports'].map(&:to_i).uniq.include?(node['openstack']['dashboard']['http_port'].to_i) %>
Listen *:<%= node['openstack']['dashboard']['http_port'].to_i%>
NameVirtualHost *:<%= node['openstack']['dashboard']['http_port'].to_i%>
<% end -%>
<VirtualHost *:<%= node['openstack']['dashboard']['http_port'] %>>
<% if node["openstack"]["dashboard"]["server_hostname"] -%>
ServerName <%= node["openstack"]["dashboard"]["server_hostname"] %>
<% end -%>
<% if node["openstack"]["dashboard"]["use_ssl"] %>
RewriteEngine On
RewriteCond %{HTTPS} off
<% if node['openstack']['dashboard']['http_port'].to_i != 80 or node['openstack']['dashboard']['https_port'].to_i != 443 %>
RewriteRule ^(.*)$ https://%{SERVER_NAME}:<%= node['openstack']['dashboard']['https_port'] %>%{REQUEST_URI} [L,R]
<% else -%>
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
<% end -%>
TraceEnable <%= node['openstack']['dashboard']['traceenable'] %>
</VirtualHost>
<% unless node['apache']['listen_ports'].map(&:to_i).uniq.include?(node['openstack']['dashboard']['https_port'].to_i) %>
Listen *:<%= node['openstack']['dashboard']['https_port'].to_i%>
NameVirtualHost *:<%= node['openstack']['dashboard']['https_port'].to_i%>
<% end -%>
<VirtualHost *:<%= node['openstack']['dashboard']['https_port'] %>>
<% if node["openstack"]["dashboard"]["server_hostname"] -%>
ServerName <%= node["openstack"]["dashboard"]["server_hostname"] %>
<% end -%>
<% end %>
ServerAdmin <%= node["apache"]["contact"] %>
WSGIScriptAlias <%= node["openstack"]["dashboard"]["webroot"] %> <%= node["openstack"]["dashboard"]["wsgi_path"] %>
WSGIDaemonProcess dashboard user=<%= node['openstack']['dashboard']['horizon_user'] %> group=<%= node['openstack']['dashboard']['horizon_group'] %> processes=3 threads=10 python-path=<%= node["openstack"]["dashboard"]["dash_path"] %>
WSGIProcessGroup dashboard
DocumentRoot <%= node["openstack"]["dashboard"]["dash_path"] %>/.blackhole/
Alias /static <%= node["openstack"]["dashboard"]["static_path"] %>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory <%= node["openstack"]["dashboard"]["dash_path"] %>>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
<% if node['apache']['version'] == '2.4' -%>
Require all granted
<% else -%>
Order allow,deny
allow from all
<% end -%>
</Directory>
<Directory <%= node["openstack"]["dashboard"]["static_path"] %>>
Options FollowSymLinks MultiViews
AllowOverride None
<% if node['apache']['version'] == '2.4' -%>
Require all granted
<% else -%>
Order allow,deny
allow from all
<% end -%>
</Directory>
<% if node["openstack"]["dashboard"]["use_ssl"] %>
SSLEngine on
SSLCertificateFile <%= @ssl_cert_file %>
SSLCertificateKeyFile <%= @ssl_key_file %>
SSLProtocol <%= node["openstack"]["dashboard"]["ssl"]["protocol"] %>
<% end %>
# Allow custom files to overlay the site (such as logo.png)
RewriteEngine On
RewriteCond /opt/dash/site_overlay%{REQUEST_FILENAME} -s
RewriteRule ^/(.+) /opt/dash/site_overlay/$1 [L]
ErrorLog <%= node["apache"]["log_dir"] %>/<%= node["openstack"]["dashboard"]["error_log"] %>
LogLevel warn
CustomLog <%= node["apache"]["log_dir"] %>/<%= node["openstack"]["dashboard"]["access_log"] %> combined
TraceEnable <%= node['openstack']['dashboard']['traceenable'] %>
</VirtualHost>
<% unless node["openstack"]["dashboard"]["wsgi_socket_prefix"].nil? %>
WSGISocketPrefix <%= node["openstack"]["dashboard"]["wsgi_socket_prefix"] %>
<% end %>