add cache config

This commit is contained in:
psy 2023-07-16 17:16:58 +02:00
parent daef88d92f
commit 040a5e8f58
No known key found for this signature in database
GPG key ID: 30546501FF65B1A5
2 changed files with 13 additions and 0 deletions

View file

@ -120,6 +120,9 @@ alias: None
# Array of custom config strings to add to the vhost config, the ";" is added after every entry # Array of custom config strings to add to the vhost config, the ";" is added after every entry
custom: [] custom: []
# name of the cache to use, only set if not none
cache: None
``` ```
**authconfig** **authconfig**

View file

@ -47,7 +47,17 @@ server {
{% if location.backend|d(False) %} {% if location.backend|d(False) %}
proxy_pass {{ location.backend }}; proxy_pass {{ location.backend }};
{% if location.cache|d(False) %}
proxy_cache {{ location.cache }};
proxy_cache_revalidate on;
proxy_cache_lock on;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
# for debugging purposes, add the following header
#add_header X-Cache-Status $upstream_cache_status;
{% else %}
proxy_buffering off; proxy_buffering off;
{% endif %}
# add proxy headers # add proxy headers
proxy_set_header Host {{ location.host|d(vhost.host) }}; proxy_set_header Host {{ location.host|d(vhost.host) }};