add cache config
This commit is contained in:
parent
daef88d92f
commit
040a5e8f58
2 changed files with 13 additions and 0 deletions
|
|
@ -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**
|
||||||
|
|
|
||||||
|
|
@ -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) }};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue