puppet-httpd/templates/vhost-proxy.conf.erb
Jeremy Stanley eec99fedb9 Allow access to docroot for proxy exclusions
In a httpd::vhost::proxy resource, if proxy exclusions and a docroot
are specified, we should allow clients to access contents of the
docroot.

Change-Id: If30b192b8f2c16375aa534131217a5aa2a9ff47d
2018-02-22 16:28:32 +00:00

50 lines
1.5 KiB
Plaintext

NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
<% if @ssl == true %>
SSLEngine on
SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2
SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!EXP:!LOW:!MEDIUM
SSLCertificateFile <%= @ssl_path %>/certs/pl.cert
SSLCertificateKeyFile <%= @ssl_path %>/private/pl.key
<% end %>
ServerName <%= @srvname %>
<% if @serveraliases.is_a? Array %>
<% @serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
<% elsif @serveraliases != nil %>
<%= " ServerAlias #{@serveraliases}" %>
<% end %>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Proxy>
<% if @proxyexclusions.is_a? Array %>
<% @proxyexclusions.each do |name| %><%= " ProxyPass #{name} !\n" %><% end %>
<% elsif @proxyexclusions != nil %>
<%= " ProxyPass #{@proxyexclusions} !" %>
<% end %>
ProxyPass / <%= @dest %>/
ProxyPassReverse / <%= @dest %>/
ProxyPreserveHost On
<% if @proxyexclusions != nil and @docroot != nil %>
DocumentRoot <%= @docroot %>
<Directory <%= @docroot %>>
Order deny,allow
Allow from all
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
<% end %>
ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
</VirtualHost>