Merge "Use caching reverse proxy for rdo repos"

This commit is contained in:
Jenkins 2017-03-30 15:18:54 +00:00 committed by Gerrit Code Review
commit ab154ab0f9
2 changed files with 45 additions and 0 deletions

View File

@ -202,6 +202,14 @@ class openstack_project::mirror (
# Build VHost
include ::httpd
file { '/opt/apache_cache':
ensure => directory,
owner => 'www-data',
group => 'www-data',
mode => '0755',
require => Class['httpd']
}
if ! defined(Httpd::Mod['rewrite']) {
httpd::mod { 'rewrite':
ensure => present,
@ -214,6 +222,24 @@ class openstack_project::mirror (
}
}
if ! defined(Httpd::Mod['cache']) {
httpd::mod { 'cache':
ensure => present,
}
}
if ! defined(Httpd::Mod['cache_disk']) {
httpd::mod { 'cache_disk':
ensure => present,
}
}
if ! defined(Httpd::Mod['proxy']) {
httpd::mod { 'proxy':
ensure => present,
}
}
::httpd::vhost { $vhost_name:
port => 80,
priority => '50',

View File

@ -81,4 +81,23 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
ServerSignature Off
# Caching reverse proxy for things that don't make sense in AFS
#
# General cache rules
CacheRoot "/opt/apache_cache"
CacheDirLevels 5
CacheDirLength 3
# Prevent thundering herds.
CacheLock on
CacheLockPath "/tmp/mod_cache-lock"
CacheLockMaxAge 5
# 100MB
CacheMaxFileSize 104857600
# Per site caching reverse proxy rules
# Only cache specific backends, rely on afs cache otherwise.
CacheEnable disk "/rdo"
ProxyPass "/rdo" "https://trunk.rdoproject.org/"
ProxyPassReverse "/rdo" "https://trunk.rdoproject.org/"
</VirtualHost>