@@ -15,6 +15,38 @@ upstream {{ item.value.upstreams[upstream].name }} {
15
15
{% endfor %}
16
16
{% endif %}
17
17
18
+ {% if item .value .reverse_proxy is defined %}
19
+ {% if item .value .reverse_proxy .proxy_cache_path is defined %}
20
+ {% for proxy_cache_path in item .value .reverse_proxy .proxy_cache_path %}
21
+ proxy_cache_path {{ proxy_cache_path.path }} keys_zone={{ proxy_cache_path.keys_zone.name }}:{{ proxy_cache_path.keys_zone.size }}
22
+ levels={{ proxy_cache_path.levels }} max_size={{ proxy_cache_path.max_size }}
23
+ inactive={{ proxy_cache_path.inactive }} use_temp_path={{ proxy_cache_path.use_temp_path | ternary("on", "off") }};
24
+ {% endfor %}
25
+
26
+ {% if item .value .reverse_proxy .proxy_cache_background_update is defined %}
27
+ proxy_cache_background_update {{ item.value.reverse_proxy.proxy_cache_background_update | ternary("on", "off") }};
28
+ {% endif %}
29
+ {% if item .value .reverse_proxy .proxy_cache_lock is defined %}
30
+ proxy_cache_lock {{ item.value.reverse_proxy.proxy_cache_lock | ternary("on", "off") }};
31
+ {% endif %}
32
+ {% if item .value .reverse_proxy .proxy_cache_min_uses is defined %}
33
+ proxy_cache_min_uses {{ item.value.reverse_proxy.proxy_cache_min_uses }};
34
+ {% endif %}
35
+ {% if item .value .reverse_proxy .proxy_cache_revalidate is defined %}
36
+ proxy_cache_revalidate {{ item.value.reverse_proxy.proxy_cache_revalidate | ternary("on", "off") }};
37
+ {% endif %}
38
+ {% if item .value .reverse_proxy .proxy_cache_use_stale is defined %}
39
+ proxy_cache_use_stale {{ item.value.reverse_proxy.proxy_cache_use_stale | join(" ") }};
40
+ {% endif %}
41
+ {% if item .value .reverse_proxy .proxy_ignore_headers is defined %}
42
+ proxy_ignore_headers {{ item.value.reverse_proxy.proxy_ignore_headers | join(" ") }};
43
+ {% endif %}
44
+ {% if item .value .reverse_proxy .proxy_temp_path is defined %}
45
+ 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("") }};
46
+ {% endif %}
47
+ {% endif %}
48
+ {% endif %}
49
+
18
50
server {
19
51
{% if item .value .ssl is defined %}
20
52
listen {{ item.value.port }} ssl;
@@ -30,6 +62,7 @@ server {
30
62
{% if item .value .https_redirect is defined and item .value .https_redirect %}
31
63
return 301 https://{{ item.value.server_name }}$request_uri;
32
64
{% endif %}
65
+
33
66
{% if item .value .reverse_proxy is defined %}
34
67
{% for location in item .value .reverse_proxy .locations %}
35
68
location {{ item.value.reverse_proxy.locations[location] .location }} {
@@ -40,9 +73,35 @@ server {
40
73
auth_basic_user_file {{ item.value.reverse_proxy.locations[location] .auth_basic_file }};
41
74
{% endif %}
42
75
proxy_pass {{ item.value.reverse_proxy.locations[location] .proxy_pass }};
43
- {% if item .value .reverse_proxy .health_check_plus is defined and item .value .reverse_proxy .health_check_plus %}
76
+
77
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache is defined %}
78
+ proxy_cache {{ item.value.reverse_proxy.locations[location] .proxy_cache }};
79
+ {% endif %}
80
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache_background_update is defined %}
81
+ proxy_cache_background_update {{ item.value.reverse_proxy.locations[location] .proxy_cache_background_update | ternary("on", "off") }};
82
+ {% endif %}
83
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache_lock is defined %}
84
+ proxy_cache_lock {{ item.value.reverse_proxy.locations[location] .proxy_cache_lock | ternary("on", "off") }};
85
+ {% endif %}
86
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache_min_uses is defined %}
87
+ proxy_cache_min_uses {{ item.value.reverse_proxy.locations[location] .proxy_cache_min_uses }};
88
+ {% endif %}
89
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache_revalidate is defined %}
90
+ proxy_cache_revalidate {{ item.value.reverse_proxy.locations[location] .proxy_cache_revalidate | ternary("on", "off") }};
91
+ {% endif %}
92
+ {% if item .value .reverse_proxy .locations [location ].proxy_cache_use_stale is defined %}
93
+ proxy_cache_use_stale {{ item.value.reverse_proxy.locations[location] .proxy_cache_use_stale | join(" ") }};
94
+ {% endif %}
95
+ {% if item .value .reverse_proxy .locations [location ].proxy_temp_path is defined %}
96
+ proxy_temp_path {{ item.value.reverse_proxy.locations[location] .proxy_temp_path.path }} {{ item.value.reverse_proxy.locations[location] .proxy_temp_path.level_1 | default("") }} {{ item.value.reverse_proxy.locations[location] .proxy_temp_path.level_2 | default("") }} {{ item.value.reverse_proxy.locations[location] .proxy_temp_path.level_3 | default("") }};
97
+ {% endif %}
98
+ {% if item .value .reverse_proxy .locations [location ].proxy_ignore_headers is defined %}
99
+ proxy_ignore_headers {{ item.value.reverse_proxy.locations[location] .proxy_ignore_headers | join(" ") }};
100
+ {% endif %}
101
+ {% if (item .value .reverse_proxy .health_check_plus is defined ) and item .value .reverse_proxy .health_check_plus %}
44
102
health_check;
45
103
{% endif %}
104
+
46
105
proxy_set_header Host $host;
47
106
proxy_set_header X-Real-IP $remote_addr;
48
107
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -52,9 +111,9 @@ server {
52
111
proxy_set_header Connection "Upgrade";
53
112
{% endif %}
54
113
}
55
-
56
114
{% endfor %}
57
115
{% endif %}
116
+
58
117
{% if item .value .web_server is defined %}
59
118
{% for location in item .value .web_server .locations %}
60
119
location {{ item.value.web_server.locations[location] .location }} {
0 commit comments