add cache config
This commit is contained in:
parent
daef88d92f
commit
040a5e8f58
2 changed files with 13 additions and 0 deletions
|
|
@ -47,7 +47,17 @@ server {
|
|||
{% if location.backend|d(False) %}
|
||||
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;
|
||||
{% endif %}
|
||||
|
||||
# add proxy headers
|
||||
proxy_set_header Host {{ location.host|d(vhost.host) }};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue