Merge ~hloeung/content-cache-charm:cleanup into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Paul Collins
Approved revision: 2b3f15b2359e390d6d86ae0c790fbb14c15fd15d
Merged at revision: 9e1d668e53ff85b458917fc955774f2ab45fcd0e
Proposed branch: ~hloeung/content-cache-charm:cleanup
Merge into: content-cache-charm:master
Diff against target: 496 lines (+53/-51)
11 files modified
files/nginx-logging-format.conf (+1/-1)
reactive/content_cache.py (+3/-1)
tests/unit/files/content_cache_rendered_haproxy_test_output.txt (+9/-9)
tests/unit/files/content_cache_rendered_haproxy_test_output2.txt (+1/-1)
tests/unit/files/content_cache_rendered_haproxy_test_output3.txt (+1/-1)
tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt (+9/-9)
tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt (+1/-1)
tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt (+9/-9)
tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt (+9/-9)
tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt (+9/-9)
tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt (+1/-1)
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Canonical IS Reviewers Pending
Review via email: mp+397710@code.launchpad.net

Commit message

Back to X-Forwarded-For as some things expect it to be this (e.g. Moin

To post a comment you must log in.
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

Change successfully merged at revision 9e1d668e53ff85b458917fc955774f2ab45fcd0e

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/nginx-logging-format.conf b/files/nginx-logging-format.conf
2index b9df464..a646743 100644
3--- a/files/nginx-logging-format.conf
4+++ b/files/nginx-logging-format.conf
5@@ -1,4 +1,4 @@
6-log_format content_cache '$http_x_cache_request_ip - $remote_user [$time_local] '
7+log_format content_cache '$http_x_forwarded_for - $remote_user [$time_local] '
8 '"$request" $status $bytes_sent '
9 '"$http_referer" "$http_user_agent" $request_time '
10 '$upstream_cache_status $upstream_response_time '
11diff --git a/reactive/content_cache.py b/reactive/content_cache.py
12index 9f95727..a215f62 100644
13--- a/reactive/content_cache.py
14+++ b/reactive/content_cache.py
15@@ -281,7 +281,9 @@ def configure_haproxy(): # NOQA: C901 LP#1825084
16 # Also, for caching layer, we want higher fall count as it's less
17 # likely the caching layer is down, 2 mins here (inter * fall).
18 new_cached_loc_conf['backend-fall-count'] = 60
19- new_cached_loc_conf['backend-options'] = ['http-request set-header X-Cache-Request-IP %[src]']
20+ # Rather than enable haproxy's 'option forwardfor' we want to replace
21+ # the X-F-F header in case it's spoofed.
22+ new_cached_loc_conf['backend-options'] = ['http-request set-header X-Forwarded-For %[src]']
23
24 # No backends
25 if not site_conf['locations'][location].get('backends'):
26diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
27index 658b0d1..b7bb481 100644
28--- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
29+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
30@@ -157,7 +157,7 @@ listen site9-local
31 backend backend-cached-site1-local
32 option httpchk HEAD /?token=1861920000_f3e404e205ed44749e942d481f7a7bec57c5e78a HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
33 http-request set-header Host site1.local
34- http-request set-header X-Cache-Request-IP %[src]
35+ http-request set-header X-Forwarded-For %[src]
36 balance leastconn
37 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 600
38
39@@ -173,7 +173,7 @@ backend backend-site1-local
40 backend backend-cached-site2-local
41 option httpchk GET /check/ HTTP/1.0\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk
42 http-request set-header Host site2.local
43- http-request set-header X-Cache-Request-IP %[src]
44+ http-request set-header X-Forwarded-For %[src]
45 balance leastconn
46 server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072
47
48@@ -189,7 +189,7 @@ backend backend-site2-local
49 backend backend-cached-site3-local
50 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk
51 http-request set-header Host site3.local
52- http-request set-header X-Cache-Request-IP %[src]
53+ http-request set-header X-Forwarded-For %[src]
54 balance leastconn
55 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
56
57@@ -207,14 +207,14 @@ backend backend-site3-local
58 backend backend-cached-site4-local
59 option httpchk HEAD / HTTP/1.0\r\nHost:\ site4.local\r\nUser-Agent:\ haproxy/httpchk
60 http-request set-header Host site4.local
61- http-request set-header X-Cache-Request-IP %[src]
62+ http-request set-header X-Forwarded-For %[src]
63 balance leastconn
64 server server_1 127.0.0.1:6083 check inter 2s rise 2 fall 60 maxconn 200
65
66 backend backend-cached-site5
67 option httpchk HEAD / HTTP/1.0\r\nHost:\ site5.local\r\nUser-Agent:\ haproxy/httpchk
68 http-request set-header Host site5.local
69- http-request set-header X-Cache-Request-IP %[src]
70+ http-request set-header X-Forwarded-For %[src]
71 balance leastconn
72 server server_1 127.0.0.1:6084 check inter 2s rise 2 fall 60 maxconn 200
73
74@@ -235,7 +235,7 @@ backend backend-site5-2
75 backend backend-cached-site6-local
76 option httpchk HEAD / HTTP/1.0\r\nHost:\ site6.local\r\nUser-Agent:\ haproxy/httpchk
77 http-request set-header Host site6.local
78- http-request set-header X-Cache-Request-IP %[src]
79+ http-request set-header X-Forwarded-For %[src]
80 balance leastconn
81 server server_1 127.0.0.1:6085 check inter 2s rise 2 fall 60 maxconn 200
82
83@@ -249,7 +249,7 @@ backend backend-site6-local
84 backend backend-cached-site7-local
85 option httpchk HEAD / HTTP/1.0\r\nHost:\ site7.local\r\nUser-Agent:\ haproxy/httpchk
86 http-request set-header Host site7.local
87- http-request set-header X-Cache-Request-IP %[src]
88+ http-request set-header X-Forwarded-For %[src]
89 balance leastconn
90 server server_1 127.0.0.1:6086 check inter 2s rise 2 fall 60 maxconn 200
91
92@@ -263,7 +263,7 @@ backend backend-site7-local
93 backend backend-cached-site8-local
94 option httpchk HEAD / HTTP/1.0\r\nHost:\ site8.local\r\nUser-Agent:\ haproxy/httpchk
95 http-request set-header Host site8.local
96- http-request set-header X-Cache-Request-IP %[src]
97+ http-request set-header X-Forwarded-For %[src]
98 balance leastconn
99 server server_1 127.0.0.1:6087 check inter 2s rise 2 fall 60 maxconn 200
100
101@@ -284,7 +284,7 @@ backend backend-site8-local-2
102 backend backend-cached-site9-local
103 option httpchk HEAD / HTTP/1.0\r\nHost:\ site9.local\r\nUser-Agent:\ haproxy/httpchk
104 http-request set-header Host site9.local
105- http-request set-header X-Cache-Request-IP %[src]
106+ http-request set-header X-Forwarded-For %[src]
107 balance leastconn
108 server server_1 127.0.0.1:6088 check inter 2s rise 2 fall 60 maxconn 200
109
110diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt
111index 7931e5e..a571e92 100644
112--- a/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt
113+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output2.txt
114@@ -92,7 +92,7 @@ listen site1-local
115 backend backend-cached-site1-local
116 option httpchk HEAD / HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
117 http-request set-header Host site1.local
118- http-request set-header X-Cache-Request-IP %[src]
119+ http-request set-header X-Forwarded-For %[src]
120 balance leastconn
121 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 200
122
123diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt
124index e8536e0..bd66f8d 100644
125--- a/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt
126+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output3.txt
127@@ -98,7 +98,7 @@ listen site1-local
128 backend backend-cached-site1-local
129 option httpchk HEAD / HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
130 http-request set-header Host site1.local
131- http-request set-header X-Cache-Request-IP %[src]
132+ http-request set-header X-Forwarded-For %[src]
133 balance leastconn
134 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 200
135
136diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
137index 47c5663..d28fd68 100644
138--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
139+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
140@@ -157,7 +157,7 @@ listen site9-local
141 backend backend-cached-site1-local
142 option httpchk HEAD /?token=1861920000_f3e404e205ed44749e942d481f7a7bec57c5e78a HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
143 http-request set-header Host site1.local
144- http-request set-header X-Cache-Request-IP %[src]
145+ http-request set-header X-Forwarded-For %[src]
146 balance leastconn
147 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 600
148
149@@ -173,7 +173,7 @@ backend backend-site1-local
150 backend backend-cached-site2-local
151 option httpchk GET /check/ HTTP/1.0\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk
152 http-request set-header Host site2.local
153- http-request set-header X-Cache-Request-IP %[src]
154+ http-request set-header X-Forwarded-For %[src]
155 balance leastconn
156 server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072
157
158@@ -189,7 +189,7 @@ backend backend-site2-local
159 backend backend-cached-site3-local
160 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk
161 http-request set-header Host site3.local
162- http-request set-header X-Cache-Request-IP %[src]
163+ http-request set-header X-Forwarded-For %[src]
164 balance leastconn
165 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
166
167@@ -207,14 +207,14 @@ backend backend-site3-local
168 backend backend-cached-site4-local
169 option httpchk HEAD / HTTP/1.0\r\nHost:\ site4.local\r\nUser-Agent:\ haproxy/httpchk
170 http-request set-header Host site4.local
171- http-request set-header X-Cache-Request-IP %[src]
172+ http-request set-header X-Forwarded-For %[src]
173 balance leastconn
174 server server_1 127.0.0.1:6083 check inter 2s rise 2 fall 60 maxconn 200
175
176 backend backend-cached-site5
177 option httpchk HEAD / HTTP/1.0\r\nHost:\ site5.local\r\nUser-Agent:\ haproxy/httpchk
178 http-request set-header Host site5.local
179- http-request set-header X-Cache-Request-IP %[src]
180+ http-request set-header X-Forwarded-For %[src]
181 balance leastconn
182 server server_1 127.0.0.1:6084 check inter 2s rise 2 fall 60 maxconn 200
183
184@@ -235,7 +235,7 @@ backend backend-site5-2
185 backend backend-cached-site6-local
186 option httpchk HEAD / HTTP/1.0\r\nHost:\ site6.local\r\nUser-Agent:\ haproxy/httpchk
187 http-request set-header Host site6.local
188- http-request set-header X-Cache-Request-IP %[src]
189+ http-request set-header X-Forwarded-For %[src]
190 balance leastconn
191 server server_1 127.0.0.1:6085 check inter 2s rise 2 fall 60 maxconn 200
192
193@@ -249,7 +249,7 @@ backend backend-site6-local
194 backend backend-cached-site7-local
195 option httpchk HEAD / HTTP/1.0\r\nHost:\ site7.local\r\nUser-Agent:\ haproxy/httpchk
196 http-request set-header Host site7.local
197- http-request set-header X-Cache-Request-IP %[src]
198+ http-request set-header X-Forwarded-For %[src]
199 balance leastconn
200 server server_1 127.0.0.1:6086 check inter 2s rise 2 fall 60 maxconn 200
201
202@@ -263,7 +263,7 @@ backend backend-site7-local
203 backend backend-cached-site8-local
204 option httpchk HEAD / HTTP/1.0\r\nHost:\ site8.local\r\nUser-Agent:\ haproxy/httpchk
205 http-request set-header Host site8.local
206- http-request set-header X-Cache-Request-IP %[src]
207+ http-request set-header X-Forwarded-For %[src]
208 balance leastconn
209 server server_1 127.0.0.1:6087 check inter 2s rise 2 fall 60 maxconn 200
210
211@@ -284,7 +284,7 @@ backend backend-site8-local-2
212 backend backend-cached-site9-local
213 option httpchk HEAD / HTTP/1.0\r\nHost:\ site9.local\r\nUser-Agent:\ haproxy/httpchk
214 http-request set-header Host site9.local
215- http-request set-header X-Cache-Request-IP %[src]
216+ http-request set-header X-Forwarded-For %[src]
217 balance leastconn
218 server server_1 127.0.0.1:6088 check inter 2s rise 2 fall 60 maxconn 200
219
220diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt
221index b110384..194dd4c 100644
222--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt
223+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_backup.txt
224@@ -97,7 +97,7 @@ listen site1-local-2
225 backend backend-cached-site1-local
226 option httpchk HEAD / HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
227 http-request set-header Host site1.local
228- http-request set-header X-Cache-Request-IP %[src]
229+ http-request set-header X-Forwarded-For %[src]
230 balance leastconn
231 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 400
232
233diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
234index 8ad76cb..09d9c9a 100644
235--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
236+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
237@@ -157,7 +157,7 @@ listen site9-local
238 backend backend-cached-site1-local
239 option httpchk HEAD /?token=1861920000_f3e404e205ed44749e942d481f7a7bec57c5e78a HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
240 http-request set-header Host site1.local
241- http-request set-header X-Cache-Request-IP %[src]
242+ http-request set-header X-Forwarded-For %[src]
243 balance roundrobin
244 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 600
245
246@@ -173,7 +173,7 @@ backend backend-site1-local
247 backend backend-cached-site2-local
248 option httpchk GET /check/ HTTP/1.0\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk
249 http-request set-header Host site2.local
250- http-request set-header X-Cache-Request-IP %[src]
251+ http-request set-header X-Forwarded-For %[src]
252 balance roundrobin
253 server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072
254
255@@ -189,7 +189,7 @@ backend backend-site2-local
256 backend backend-cached-site3-local
257 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk
258 http-request set-header Host site3.local
259- http-request set-header X-Cache-Request-IP %[src]
260+ http-request set-header X-Forwarded-For %[src]
261 balance roundrobin
262 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
263
264@@ -207,14 +207,14 @@ backend backend-site3-local
265 backend backend-cached-site4-local
266 option httpchk HEAD / HTTP/1.0\r\nHost:\ site4.local\r\nUser-Agent:\ haproxy/httpchk
267 http-request set-header Host site4.local
268- http-request set-header X-Cache-Request-IP %[src]
269+ http-request set-header X-Forwarded-For %[src]
270 balance roundrobin
271 server server_1 127.0.0.1:6083 check inter 2s rise 2 fall 60 maxconn 200
272
273 backend backend-cached-site5
274 option httpchk HEAD / HTTP/1.0\r\nHost:\ site5.local\r\nUser-Agent:\ haproxy/httpchk
275 http-request set-header Host site5.local
276- http-request set-header X-Cache-Request-IP %[src]
277+ http-request set-header X-Forwarded-For %[src]
278 balance roundrobin
279 server server_1 127.0.0.1:6084 check inter 2s rise 2 fall 60 maxconn 200
280
281@@ -235,7 +235,7 @@ backend backend-site5-2
282 backend backend-cached-site6-local
283 option httpchk HEAD / HTTP/1.0\r\nHost:\ site6.local\r\nUser-Agent:\ haproxy/httpchk
284 http-request set-header Host site6.local
285- http-request set-header X-Cache-Request-IP %[src]
286+ http-request set-header X-Forwarded-For %[src]
287 balance roundrobin
288 server server_1 127.0.0.1:6085 check inter 2s rise 2 fall 60 maxconn 200
289
290@@ -249,7 +249,7 @@ backend backend-site6-local
291 backend backend-cached-site7-local
292 option httpchk HEAD / HTTP/1.0\r\nHost:\ site7.local\r\nUser-Agent:\ haproxy/httpchk
293 http-request set-header Host site7.local
294- http-request set-header X-Cache-Request-IP %[src]
295+ http-request set-header X-Forwarded-For %[src]
296 balance roundrobin
297 server server_1 127.0.0.1:6086 check inter 2s rise 2 fall 60 maxconn 200
298
299@@ -263,7 +263,7 @@ backend backend-site7-local
300 backend backend-cached-site8-local
301 option httpchk HEAD / HTTP/1.0\r\nHost:\ site8.local\r\nUser-Agent:\ haproxy/httpchk
302 http-request set-header Host site8.local
303- http-request set-header X-Cache-Request-IP %[src]
304+ http-request set-header X-Forwarded-For %[src]
305 balance roundrobin
306 server server_1 127.0.0.1:6087 check inter 2s rise 2 fall 60 maxconn 200
307
308@@ -284,7 +284,7 @@ backend backend-site8-local-2
309 backend backend-cached-site9-local
310 option httpchk HEAD / HTTP/1.0\r\nHost:\ site9.local\r\nUser-Agent:\ haproxy/httpchk
311 http-request set-header Host site9.local
312- http-request set-header X-Cache-Request-IP %[src]
313+ http-request set-header X-Forwarded-For %[src]
314 balance roundrobin
315 server server_1 127.0.0.1:6088 check inter 2s rise 2 fall 60 maxconn 200
316
317diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
318index fb75f2e..5d012fb 100644
319--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
320+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
321@@ -158,7 +158,7 @@ listen site9-local
322 backend backend-cached-site1-local
323 option httpchk HEAD /?token=1861920000_f3e404e205ed44749e942d481f7a7bec57c5e78a HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
324 http-request set-header Host site1.local
325- http-request set-header X-Cache-Request-IP %[src]
326+ http-request set-header X-Forwarded-For %[src]
327 balance leastconn
328 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 600
329
330@@ -174,7 +174,7 @@ backend backend-site1-local
331 backend backend-cached-site2-local
332 option httpchk GET /check/ HTTP/1.0\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk
333 http-request set-header Host site2.local
334- http-request set-header X-Cache-Request-IP %[src]
335+ http-request set-header X-Forwarded-For %[src]
336 balance leastconn
337 server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072
338
339@@ -190,7 +190,7 @@ backend backend-site2-local
340 backend backend-cached-site3-local
341 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk
342 http-request set-header Host site3.local
343- http-request set-header X-Cache-Request-IP %[src]
344+ http-request set-header X-Forwarded-For %[src]
345 balance leastconn
346 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
347
348@@ -208,14 +208,14 @@ backend backend-site3-local
349 backend backend-cached-site4-local
350 option httpchk HEAD / HTTP/1.0\r\nHost:\ site4.local\r\nUser-Agent:\ haproxy/httpchk
351 http-request set-header Host site4.local
352- http-request set-header X-Cache-Request-IP %[src]
353+ http-request set-header X-Forwarded-For %[src]
354 balance leastconn
355 server server_1 127.0.0.1:6083 check inter 2s rise 2 fall 60 maxconn 200
356
357 backend backend-cached-site5
358 option httpchk HEAD / HTTP/1.0\r\nHost:\ site5.local\r\nUser-Agent:\ haproxy/httpchk
359 http-request set-header Host site5.local
360- http-request set-header X-Cache-Request-IP %[src]
361+ http-request set-header X-Forwarded-For %[src]
362 balance leastconn
363 server server_1 127.0.0.1:6084 check inter 2s rise 2 fall 60 maxconn 200
364
365@@ -236,7 +236,7 @@ backend backend-site5-2
366 backend backend-cached-site6-local
367 option httpchk HEAD / HTTP/1.0\r\nHost:\ site6.local\r\nUser-Agent:\ haproxy/httpchk
368 http-request set-header Host site6.local
369- http-request set-header X-Cache-Request-IP %[src]
370+ http-request set-header X-Forwarded-For %[src]
371 balance leastconn
372 server server_1 127.0.0.1:6085 check inter 2s rise 2 fall 60 maxconn 200
373
374@@ -250,7 +250,7 @@ backend backend-site6-local
375 backend backend-cached-site7-local
376 option httpchk HEAD / HTTP/1.0\r\nHost:\ site7.local\r\nUser-Agent:\ haproxy/httpchk
377 http-request set-header Host site7.local
378- http-request set-header X-Cache-Request-IP %[src]
379+ http-request set-header X-Forwarded-For %[src]
380 balance leastconn
381 server server_1 127.0.0.1:6086 check inter 2s rise 2 fall 60 maxconn 200
382
383@@ -264,7 +264,7 @@ backend backend-site7-local
384 backend backend-cached-site8-local
385 option httpchk HEAD / HTTP/1.0\r\nHost:\ site8.local\r\nUser-Agent:\ haproxy/httpchk
386 http-request set-header Host site8.local
387- http-request set-header X-Cache-Request-IP %[src]
388+ http-request set-header X-Forwarded-For %[src]
389 balance leastconn
390 server server_1 127.0.0.1:6087 check inter 2s rise 2 fall 60 maxconn 200
391
392@@ -285,7 +285,7 @@ backend backend-site8-local-2
393 backend backend-cached-site9-local
394 option httpchk HEAD / HTTP/1.0\r\nHost:\ site9.local\r\nUser-Agent:\ haproxy/httpchk
395 http-request set-header Host site9.local
396- http-request set-header X-Cache-Request-IP %[src]
397+ http-request set-header X-Forwarded-For %[src]
398 balance leastconn
399 server server_1 127.0.0.1:6088 check inter 2s rise 2 fall 60 maxconn 200
400
401diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
402index f6c4138..97611bf 100644
403--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
404+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
405@@ -157,7 +157,7 @@ listen site9-local
406 backend backend-cached-site1-local
407 option httpchk HEAD /?token=1861920000_f3e404e205ed44749e942d481f7a7bec57c5e78a HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
408 http-request set-header Host site1.local
409- http-request set-header X-Cache-Request-IP %[src]
410+ http-request set-header X-Forwarded-For %[src]
411 balance leastconn
412 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 600
413
414@@ -174,7 +174,7 @@ backend backend-site1-local
415 backend backend-cached-site2-local
416 option httpchk GET /check/ HTTP/1.0\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk
417 http-request set-header Host site2.local
418- http-request set-header X-Cache-Request-IP %[src]
419+ http-request set-header X-Forwarded-For %[src]
420 balance leastconn
421 server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072
422
423@@ -191,7 +191,7 @@ backend backend-site2-local
424 backend backend-cached-site3-local
425 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk
426 http-request set-header Host site3.local
427- http-request set-header X-Cache-Request-IP %[src]
428+ http-request set-header X-Forwarded-For %[src]
429 balance leastconn
430 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
431
432@@ -210,14 +210,14 @@ backend backend-site3-local
433 backend backend-cached-site4-local
434 option httpchk HEAD / HTTP/1.0\r\nHost:\ site4.local\r\nUser-Agent:\ haproxy/httpchk
435 http-request set-header Host site4.local
436- http-request set-header X-Cache-Request-IP %[src]
437+ http-request set-header X-Forwarded-For %[src]
438 balance leastconn
439 server server_1 127.0.0.1:6083 check inter 2s rise 2 fall 60 maxconn 200
440
441 backend backend-cached-site5
442 option httpchk HEAD / HTTP/1.0\r\nHost:\ site5.local\r\nUser-Agent:\ haproxy/httpchk
443 http-request set-header Host site5.local
444- http-request set-header X-Cache-Request-IP %[src]
445+ http-request set-header X-Forwarded-For %[src]
446 balance leastconn
447 server server_1 127.0.0.1:6084 check inter 2s rise 2 fall 60 maxconn 200
448
449@@ -240,7 +240,7 @@ backend backend-site5-2
450 backend backend-cached-site6-local
451 option httpchk HEAD / HTTP/1.0\r\nHost:\ site6.local\r\nUser-Agent:\ haproxy/httpchk
452 http-request set-header Host site6.local
453- http-request set-header X-Cache-Request-IP %[src]
454+ http-request set-header X-Forwarded-For %[src]
455 balance leastconn
456 server server_1 127.0.0.1:6085 check inter 2s rise 2 fall 60 maxconn 200
457
458@@ -255,7 +255,7 @@ backend backend-site6-local
459 backend backend-cached-site7-local
460 option httpchk HEAD / HTTP/1.0\r\nHost:\ site7.local\r\nUser-Agent:\ haproxy/httpchk
461 http-request set-header Host site7.local
462- http-request set-header X-Cache-Request-IP %[src]
463+ http-request set-header X-Forwarded-For %[src]
464 balance leastconn
465 server server_1 127.0.0.1:6086 check inter 2s rise 2 fall 60 maxconn 200
466
467@@ -270,7 +270,7 @@ backend backend-site7-local
468 backend backend-cached-site8-local
469 option httpchk HEAD / HTTP/1.0\r\nHost:\ site8.local\r\nUser-Agent:\ haproxy/httpchk
470 http-request set-header Host site8.local
471- http-request set-header X-Cache-Request-IP %[src]
472+ http-request set-header X-Forwarded-For %[src]
473 balance leastconn
474 server server_1 127.0.0.1:6087 check inter 2s rise 2 fall 60 maxconn 200
475
476@@ -293,7 +293,7 @@ backend backend-site8-local-2
477 backend backend-cached-site9-local
478 option httpchk HEAD / HTTP/1.0\r\nHost:\ site9.local\r\nUser-Agent:\ haproxy/httpchk
479 http-request set-header Host site9.local
480- http-request set-header X-Cache-Request-IP %[src]
481+ http-request set-header X-Forwarded-For %[src]
482 balance leastconn
483 server server_1 127.0.0.1:6088 check inter 2s rise 2 fall 60 maxconn 200
484
485diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt
486index 72b12df..a88388d 100644
487--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt
488+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_srv_template.txt
489@@ -92,7 +92,7 @@ listen site1-local
490 backend backend-cached-site1-local
491 option httpchk HEAD / HTTP/1.0\r\nHost:\ site1.local\r\nUser-Agent:\ haproxy/httpchk
492 http-request set-header Host site1.local
493- http-request set-header X-Cache-Request-IP %[src]
494+ http-request set-header X-Forwarded-For %[src]
495 balance leastconn
496 server server_1 127.0.0.1:6080 check inter 2s rise 2 fall 60 maxconn 400
497

Subscribers

People subscribed via source and target branches