ptgbot: have apache cache backend

The static server in the ptgbot container is very simple; it will be
much better to have apache caching the files which essentially never
change.

Change-Id: I8056d8c529c60f4b95aaca549528b6aa8465fa78
This commit is contained in:
Ian Wienand 2021-10-14 09:47:26 +11:00
parent cced838bf0
commit 051aee9f16
2 changed files with 23 additions and 0 deletions

View File

@ -63,6 +63,9 @@
state: present
name: "{{ item }}"
loop:
- cache
- cache_disk
- cache_socache
- rewrite
- proxy
- proxy_http
@ -70,6 +73,14 @@
- headers
- proxy_wstunnel
- name: Ensure apache cache dir
file:
state: directory
path: '/var/cache/apache2/proxy'
owner: root
group: root
mode: 0755
- name: Copy apache config
template:
src: ptgbot.vhost.config.j2

View File

@ -42,6 +42,18 @@
SSLCertificateKeyFile /etc/letsencrypt-certs/ptg.opendev.org/ptg.opendev.org.key
SSLCertificateChainFile /etc/letsencrypt-certs/ptg.opendev.org/ca.cer
# Enable SHM backend
CacheSocache shmcb
# disk fallback
CacheRoot "/var/cache/apache2/proxy"
# required to match on rewrites
CacheQuickHandler off
# don't pass requests to backend
CacheIgnoreCacheControl On
CacheEnable socache /
CacheEnable disk /
ProxyPass / http://localhost:8000/ retry=0
ProxyPassReverse / http://localhost:8000/