>
ServerName <%= @params[:server_name] %>
ServerAlias <% @params[:server_aliases].each do |a| %><%= a %> <% end %>
FileETag -INode
DocumentRoot <%= @params[:docroot] %>
RewriteEngine On
RewriteRule ^/(nagios|jenkins|scratchpad)$ https://%{HTTP_HOST}/$1/ [R=301,NC,L]
<% if @params[:server_port].to_s.match(/443$/) %>
SSLEngine On
SSLCertificateFile <%= $MU_CFG['ssl']['cert'] %>
SSLCertificateKeyFile <%= $MU_CFG['ssl']['key'] %>
<% if $MU_CFG['ssl'].has_key?("chain") and !$MU_CFG['ssl']['chain'].empty? %>
SSLCertificateChainFile <%= $MU_CFG['ssl']['chain'] %>
<% end %>
SSLProxyEngine on
<% if node['apache']['version'] == "2.2" %>
Order allow,deny
Allow from all
<% elsif node['apache']['version'] == "2.4" %>
Require all granted
<% end %>
ProxyPreserveHost on
AllowEncodedSlashes off
# Scratchpad, the Mu secret-sharer
ProxyPass /scratchpad https://localhost:<%= MU.mommaCatPort.to_s %>/scratchpad
ProxyPassReverse /scratchpad https://localhost:<%= MU.mommaCatPort.to_s %>/scratchpad
# Nagios web UI
ProxyPass /nagios/ https://localhost:8443/nagios/
ProxyPassReverse /nagios/ https://localhost:8443/nagios/
ProxyPass /cloudamatic.png !
ProxyPass /docs/ !
ProxyPass /index.html !
# Everything else should go to the Chef API endpoint
ProxyPass / https://localhost:7443/
ProxyPassReverse / https://localhost:7443/
RequestHeader set X-Forwarded-Proto "https"
<% else %>
RewriteRule ^/(nagios|jenkins|scratchpad)/(.*) https://%{HTTP_HOST}/$1/$2 [R=301,NC,L]
<% end %>
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
>
Options <%= [@params[:directory_options] || "FollowSymLinks" ].flatten.join " " %>
AllowOverride <%= [@params[:allow_override] || "None" ].flatten.join " " %>
<% if node['apache']['version'] == "2.2" %>
Order allow,deny
Allow from all
<% elsif node['apache']['version'] == "2.4" %>
Require all granted
<% end %>
Options FollowSymLinks
AllowOverride None
SetHandler server-status
<% if node['apache']['version'] == "2.2" %>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
<% elsif node['apache']['version'] == "2.4" %>
Require host 127.0.0.1
<% end %>
<% if @params[:directory_index] -%>
DirectoryIndex <%= [@params[:directory_index]].flatten.join " " %>
<% end -%>