@@ -26,8 +26,8 @@ upstream {{ item.value.upstreams[upstream].name }} {
26
26
{% if item .value .reverse_proxy .proxy_cache_path is defined and item .value .reverse_proxy .proxy_cache_path %}
27
27
{% for proxy_cache_path in item .value .reverse_proxy .proxy_cache_path %}
28
28
proxy_cache_path {{ proxy_cache_path.path }} keys_zone={{ proxy_cache_path.keys_zone.name }}:{{ proxy_cache_path.keys_zone.size }}
29
- levels={{ proxy_cache_path.levels }} max_size={{ proxy_cache_path.max_size }}
30
- inactive={{ proxy_cache_path.inactive }} use_temp_path={{ proxy_cache_path.use_temp_path | ternary("on", "off") }};
29
+ levels={{ proxy_cache_path.levels }} max_size={{ proxy_cache_path.max_size }}
30
+ inactive={{ proxy_cache_path.inactive }} use_temp_path={{ proxy_cache_path.use_temp_path | ternary("on", "off") }};
31
31
{% endfor %}
32
32
{% if item .value .reverse_proxy .proxy_cache_background_update is defined and item .value .reverse_proxy .proxy_cache_background_update %}
33
33
proxy_cache_background_update {{ item.value.reverse_proxy.proxy_cache_background_update | ternary("on", "off") }};
@@ -50,6 +50,15 @@ proxy_ignore_headers {{ item.value.reverse_proxy.proxy_ignore_headers | join(" "
50
50
{% if item .value .reverse_proxy .proxy_temp_path is defined and item .value .reverse_proxy .proxy_temp_path .path %}
51
51
proxy_temp_path {{ item.value.reverse_proxy.proxy_temp_path.path }} {{ item.value.reverse_proxy.proxy_temp_path.level_1 | default("") }} {{ item.value.reverse_proxy.proxy_temp_path.level_2 | default("") }} {{ item.value.reverse_proxy.proxy_temp_path.level_3 | default("") }};
52
52
{% endif %}
53
+ {% if item .value .reverse_proxy .proxy_cache_valid is defined %}
54
+ {% for proxy_cache_valid in item .value .reverse_proxy .proxy_cache_valid %}
55
+ {% if proxy_cache_valid .code is defined %}
56
+ proxy_cache_valid {{ proxy_cache_valid.code }} {{ proxy_cache_valid.time | default("10m") }};
57
+ {% elif proxy_cache_valid .time is defined and proxy_cache_valid .code is not defined %}
58
+ proxy_cache_valid {{ proxy_cache_valid.time }};
59
+ {% endif %}
60
+ {% endfor %}
61
+ {% endif %}
53
62
{% endif %}
54
63
{% endif %}
55
64
{% if item .value .auth_request_http is defined %}
@@ -282,6 +291,15 @@ server {
282
291
{% if item .value .reverse_proxy .locations [location ].proxy_cache is defined %}
283
292
proxy_cache {{ item.value.reverse_proxy.locations[location] .proxy_cache }};
284
293
{% endif %}
294
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache_valid is defined %}
295
+ {% for proxy_cache_valid in item .value .reverse_proxy .locations [location ].proxy_cache_valid %}
296
+ {% if proxy_cache_valid .code is defined %}
297
+ proxy_cache_valid {{ proxy_cache_valid.code }} {{ proxy_cache_valid.time | default("10m") }};
298
+ {% elif proxy_cache_valid .time is defined and proxy_cache_valid .code is not defined %}
299
+ proxy_cache_valid {{ proxy_cache_valid.time }};
300
+ {% endif %}
301
+ {% endfor %}
302
+ {% endif %}
285
303
{% if item .value .reverse_proxy .locations [location ].proxy_cache_background_update is defined %}
286
304
proxy_cache_background_update {{ item.value.reverse_proxy.locations[location] .proxy_cache_background_update | ternary("on", "off") }};
287
305
{% endif %}
0 commit comments