Merge "Add cache-control headers for service-types.openstack.org"

This commit is contained in:
Zuul 2019-05-03 16:25:44 +00:00 committed by Gerrit Code Review
commit 65e6f62090
2 changed files with 17 additions and 0 deletions

View File

@ -16,6 +16,11 @@ class openstack_project::static (
$ssl_chain_file_contents = '',
$jenkins_gitfullname = 'OpenStack Jenkins',
$jenkins_gitemail = 'jenkins@openstack.org',
$expires = {
'service-types.openstack.org' => {
'application/json' => 'access plus 1 week'
}
}
) {
class { 'project_config':
url => $project_config_repo,
@ -63,6 +68,12 @@ class openstack_project::static (
httpd::mod { 'headers': ensure => present }
}
if ! defined(Httpd::Mod['expires']) {
httpd::mod { 'expires':
ensure => present,
}
}
if ! defined(File['/srv/static']) {
file { '/srv/static':
ensure => directory,

View File

@ -39,6 +39,12 @@
AllowOverrideList Redirect RedirectMatch
Satisfy Any
Require all granted
<%- if scope.lookupvar('openstack_project::static::expires').has_key? @vhost_name -%>
ExpiresActive On
<%- scope.lookupvar('openstack_project::static::expires')[@vhost_name].each do |key,value| -%>
ExpiresByType <% key %> "<% value %>"
<%- end -%>
<%- end -%>
</Directory>
LogLevel warn
ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log