Merge ~hloeung/content-cache-charm:fixes into content-cache-charm:master
- Git
- lp:~hloeung/content-cache-charm
- fixes
- Merge into master
Proposed by
Haw Loeung
Status: | Merged |
---|---|
Approved by: | James Simpson |
Approved revision: | 638443bfad70b34556adc506a27193ca417b6f14 |
Merged at revision: | d527d38fa781c977cbe19256adfc8198e102ec07 |
Proposed branch: | ~hloeung/content-cache-charm:fixes |
Merge into: | content-cache-charm:master |
Diff against target: |
232 lines (+60/-1) 12 files modified
reactive/content_cache.py (+5/-1) tests/unit/files/config_test_config.txt (+12/-0) tests/unit/files/content_cache_rendered_haproxy_test_output.txt (+5/-0) tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt (+5/-0) tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt (+5/-0) tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt (+5/-0) tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt (+5/-0) tests/unit/files/haproxy_config_rendered_backends_stanzas_test_output.txt (+1/-0) tests/unit/files/haproxy_config_rendered_test_output.txt (+1/-0) tests/unit/files/haproxy_config_rendered_test_output2.txt (+1/-0) tests/unit/files/haproxy_config_rendered_test_output_with_extra_configs.txt (+1/-0) tests/unit/files/nginx_config_rendered_test_output-site2.local.txt (+14/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Simpson | Approve | ||
Canonical IS Reviewers | Pending | ||
Review via email: mp+465893@code.launchpad.net |
Commit message
Fix duplicate X-F-F headers when more than one location
Description of the change
To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Change successfully merged at revision d527d38fa781c97
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/reactive/content_cache.py b/reactive/content_cache.py | |||
2 | index ebbb3ab..c110cd2 100644 | |||
3 | --- a/reactive/content_cache.py | |||
4 | +++ b/reactive/content_cache.py | |||
5 | @@ -345,7 +345,11 @@ def configure_haproxy(): # NOQA: C901 LP#1825084 | |||
6 | 345 | new_cached_loc_conf['backend-options'] = site_conf.get('haproxy-extra-configs', []) | 345 | new_cached_loc_conf['backend-options'] = site_conf.get('haproxy-extra-configs', []) |
7 | 346 | # Rather than enable haproxy's 'option forwardfor' we want to replace | 346 | # Rather than enable haproxy's 'option forwardfor' we want to replace |
8 | 347 | # the X-F-F header in case it's spoofed. | 347 | # the X-F-F header in case it's spoofed. |
10 | 348 | new_cached_loc_conf['backend-options'].insert(0, 'http-request set-header X-Forwarded-For %[src]') | 348 | if ( |
11 | 349 | len(new_cached_loc_conf['backend-options']) == 0 | ||
12 | 350 | or new_cached_loc_conf['backend-options'][0] != 'http-request set-header X-Forwarded-For %[src]' | ||
13 | 351 | ): | ||
14 | 352 | new_cached_loc_conf['backend-options'].insert(0, 'http-request set-header X-Forwarded-For %[src]') | ||
15 | 349 | 353 | ||
16 | 350 | new_cached_loc_conf['rate-limit'] = loc_conf.get('rate-limit', '') | 354 | new_cached_loc_conf['rate-limit'] = loc_conf.get('rate-limit', '') |
17 | 351 | 355 | ||
18 | diff --git a/tests/unit/files/config_test_config.txt b/tests/unit/files/config_test_config.txt | |||
19 | index eab890b..c4f748b 100644 | |||
20 | --- a/tests/unit/files/config_test_config.txt | |||
21 | +++ b/tests/unit/files/config_test_config.txt | |||
22 | @@ -30,14 +30,26 @@ site2.local: | |||
23 | 30 | - 127.0.1.10:443 | 30 | - 127.0.1.10:443 |
24 | 31 | - 127.0.1.11:443 | 31 | - 127.0.1.11:443 |
25 | 32 | - 127.0.1.12:443 | 32 | - 127.0.1.12:443 |
26 | 33 | backend-options: ['http-request set-header X-Forwarded-For %[src]'] | ||
27 | 33 | /my-local-content/: | 34 | /my-local-content/: |
28 | 34 | extra-config: | 35 | extra-config: |
29 | 35 | - root /var/www/html | 36 | - root /var/www/html |
30 | 36 | /my-local-content2/: | 37 | /my-local-content2/: |
31 | 37 | extra-configs: | 38 | extra-configs: |
32 | 38 | - root /var/www/html | 39 | - root /var/www/html |
33 | 40 | /.well-known/matrix/server: | ||
34 | 41 | extra-config: | ||
35 | 42 | - "return 200 '{\"m.server\": \"chat-server.ubuntu.com:443\"}'" | ||
36 | 43 | /.well-known/matrix/client: | ||
37 | 44 | extra-config: | ||
38 | 45 | - "return 200 '{\"m.homeserver\": {\"base_url\": \"https://chat-server.ubuntu.com\"}}'" | ||
39 | 39 | # Test default site with only a single backend. | 46 | # Test default site with only a single backend. |
40 | 40 | default: True | 47 | default: True |
41 | 48 | haproxy-extra-configs: | ||
42 | 49 | - http-request set-var(txn.path) path | ||
43 | 50 | - acl p_matrix var(txn.path) -m beg /.well-known/matrix | ||
44 | 51 | - http-response set-header Content-Type application/json if p_matrix | ||
45 | 52 | - http-response set-header Access-Control-Allow-Origin * if p_matrix | ||
46 | 41 | 53 | ||
47 | 42 | # Test 3: No port, just backends (HTTP), with custom cache-maxconn | 54 | # Test 3: No port, just backends (HTTP), with custom cache-maxconn |
48 | 43 | site3.local: | 55 | site3.local: |
49 | diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt | |||
50 | index c08bb5a..6d6cbed 100644 | |||
51 | --- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt | |||
52 | +++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt | |||
53 | @@ -209,12 +209,17 @@ backend backend-cached-site2-local | |||
54 | 209 | http-request set-header X-Orig-Host %[req.hdr(Host)] | 209 | http-request set-header X-Orig-Host %[req.hdr(Host)] |
55 | 210 | http-request set-header Host site2.local | 210 | http-request set-header Host site2.local |
56 | 211 | http-request set-header X-Forwarded-For %[src] | 211 | http-request set-header X-Forwarded-For %[src] |
57 | 212 | http-request set-var(txn.path) path | ||
58 | 213 | acl p_matrix var(txn.path) -m beg /.well-known/matrix | ||
59 | 214 | http-response set-header Content-Type application/json if p_matrix | ||
60 | 215 | http-response set-header Access-Control-Allow-Origin * if p_matrix | ||
61 | 212 | balance leastconn | 216 | balance leastconn |
62 | 213 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 | 217 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 |
63 | 214 | 218 | ||
64 | 215 | backend backend-site2-local | 219 | backend backend-site2-local |
65 | 216 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 220 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
66 | 217 | http-request set-header Host site2.local | 221 | http-request set-header Host site2.local |
67 | 222 | http-request set-header X-Forwarded-For %[src] | ||
68 | 218 | option redispatch 1 | 223 | option redispatch 1 |
69 | 219 | balance leastconn | 224 | balance leastconn |
70 | 220 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 225 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
71 | diff --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 | |||
72 | index bece830..56189ae 100644 | |||
73 | --- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt | |||
74 | +++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt | |||
75 | @@ -209,12 +209,17 @@ backend backend-cached-site2-local | |||
76 | 209 | http-request set-header X-Orig-Host %[req.hdr(Host)] | 209 | http-request set-header X-Orig-Host %[req.hdr(Host)] |
77 | 210 | http-request set-header Host site2.local | 210 | http-request set-header Host site2.local |
78 | 211 | http-request set-header X-Forwarded-For %[src] | 211 | http-request set-header X-Forwarded-For %[src] |
79 | 212 | http-request set-var(txn.path) path | ||
80 | 213 | acl p_matrix var(txn.path) -m beg /.well-known/matrix | ||
81 | 214 | http-response set-header Content-Type application/json if p_matrix | ||
82 | 215 | http-response set-header Access-Control-Allow-Origin * if p_matrix | ||
83 | 212 | balance leastconn | 216 | balance leastconn |
84 | 213 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 | 217 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 |
85 | 214 | 218 | ||
86 | 215 | backend backend-site2-local | 219 | backend backend-site2-local |
87 | 216 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 220 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
88 | 217 | http-request set-header Host site2.local | 221 | http-request set-header Host site2.local |
89 | 222 | http-request set-header X-Forwarded-For %[src] | ||
90 | 218 | option redispatch 1 | 223 | option redispatch 1 |
91 | 219 | balance leastconn | 224 | balance leastconn |
92 | 220 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 225 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
93 | diff --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 | |||
94 | index f05826e..032728a 100644 | |||
95 | --- a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt | |||
96 | +++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt | |||
97 | @@ -209,12 +209,17 @@ backend backend-cached-site2-local | |||
98 | 209 | http-request set-header X-Orig-Host %[req.hdr(Host)] | 209 | http-request set-header X-Orig-Host %[req.hdr(Host)] |
99 | 210 | http-request set-header Host site2.local | 210 | http-request set-header Host site2.local |
100 | 211 | http-request set-header X-Forwarded-For %[src] | 211 | http-request set-header X-Forwarded-For %[src] |
101 | 212 | http-request set-var(txn.path) path | ||
102 | 213 | acl p_matrix var(txn.path) -m beg /.well-known/matrix | ||
103 | 214 | http-response set-header Content-Type application/json if p_matrix | ||
104 | 215 | http-response set-header Access-Control-Allow-Origin * if p_matrix | ||
105 | 212 | balance roundrobin | 216 | balance roundrobin |
106 | 213 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 | 217 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 |
107 | 214 | 218 | ||
108 | 215 | backend backend-site2-local | 219 | backend backend-site2-local |
109 | 216 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 220 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
110 | 217 | http-request set-header Host site2.local | 221 | http-request set-header Host site2.local |
111 | 222 | http-request set-header X-Forwarded-For %[src] | ||
112 | 218 | option redispatch 1 | 223 | option redispatch 1 |
113 | 219 | balance roundrobin | 224 | balance roundrobin |
114 | 220 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 225 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
115 | diff --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 | |||
116 | index ddbc8c6..c72b5ee 100644 | |||
117 | --- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt | |||
118 | +++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt | |||
119 | @@ -210,12 +210,17 @@ backend backend-cached-site2-local | |||
120 | 210 | http-request set-header X-Orig-Host %[req.hdr(Host)] | 210 | http-request set-header X-Orig-Host %[req.hdr(Host)] |
121 | 211 | http-request set-header Host site2.local | 211 | http-request set-header Host site2.local |
122 | 212 | http-request set-header X-Forwarded-For %[src] | 212 | http-request set-header X-Forwarded-For %[src] |
123 | 213 | http-request set-var(txn.path) path | ||
124 | 214 | acl p_matrix var(txn.path) -m beg /.well-known/matrix | ||
125 | 215 | http-response set-header Content-Type application/json if p_matrix | ||
126 | 216 | http-response set-header Access-Control-Allow-Origin * if p_matrix | ||
127 | 213 | balance leastconn | 217 | balance leastconn |
128 | 214 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 | 218 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 |
129 | 215 | 219 | ||
130 | 216 | backend backend-site2-local | 220 | backend backend-site2-local |
131 | 217 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 221 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
132 | 218 | http-request set-header Host site2.local | 222 | http-request set-header Host site2.local |
133 | 223 | http-request set-header X-Forwarded-For %[src] | ||
134 | 219 | option redispatch 1 | 224 | option redispatch 1 |
135 | 220 | balance leastconn | 225 | balance leastconn |
136 | 221 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 226 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
137 | diff --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 | |||
138 | index e48af71..c5251fa 100644 | |||
139 | --- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt | |||
140 | +++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt | |||
141 | @@ -213,6 +213,10 @@ backend backend-cached-site2-local | |||
142 | 213 | http-request set-header X-Orig-Host %[req.hdr(Host)] | 213 | http-request set-header X-Orig-Host %[req.hdr(Host)] |
143 | 214 | http-request set-header Host site2.local | 214 | http-request set-header Host site2.local |
144 | 215 | http-request set-header X-Forwarded-For %[src] | 215 | http-request set-header X-Forwarded-For %[src] |
145 | 216 | http-request set-var(txn.path) path | ||
146 | 217 | acl p_matrix var(txn.path) -m beg /.well-known/matrix | ||
147 | 218 | http-response set-header Content-Type application/json if p_matrix | ||
148 | 219 | http-response set-header Access-Control-Allow-Origin * if p_matrix | ||
149 | 216 | balance leastconn | 220 | balance leastconn |
150 | 217 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 | 221 | server server_1 127.0.0.1:6081 check inter 2s rise 2 fall 60 maxconn 3072 |
151 | 218 | 222 | ||
152 | @@ -220,6 +224,7 @@ backend backend-site2-local | |||
153 | 220 | option httpchk GET /check/ HTTP/1.1 | 224 | option httpchk GET /check/ HTTP/1.1 |
154 | 221 | http-check send hdr Host site2.local hdr User-Agent haproxy/httpchk | 225 | http-check send hdr Host site2.local hdr User-Agent haproxy/httpchk |
155 | 222 | http-request set-header Host site2.local | 226 | http-request set-header Host site2.local |
156 | 227 | http-request set-header X-Forwarded-For %[src] | ||
157 | 223 | retry-on all-retryable-errors | 228 | retry-on all-retryable-errors |
158 | 224 | option redispatch 1 | 229 | option redispatch 1 |
159 | 225 | balance leastconn | 230 | balance leastconn |
160 | diff --git a/tests/unit/files/haproxy_config_rendered_backends_stanzas_test_output.txt b/tests/unit/files/haproxy_config_rendered_backends_stanzas_test_output.txt | |||
161 | index 565c469..48984b1 100644 | |||
162 | --- a/tests/unit/files/haproxy_config_rendered_backends_stanzas_test_output.txt | |||
163 | +++ b/tests/unit/files/haproxy_config_rendered_backends_stanzas_test_output.txt | |||
164 | @@ -10,6 +10,7 @@ backend backend-site1-local | |||
165 | 10 | backend backend-site2-local | 10 | backend backend-site2-local |
166 | 11 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 11 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
167 | 12 | http-request set-header Host site2.local | 12 | http-request set-header Host site2.local |
168 | 13 | http-request set-header X-Forwarded-For %[src] | ||
169 | 13 | balance leastconn | 14 | balance leastconn |
170 | 14 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 15 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
171 | 15 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 16 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
172 | diff --git a/tests/unit/files/haproxy_config_rendered_test_output.txt b/tests/unit/files/haproxy_config_rendered_test_output.txt | |||
173 | index 4121b07..ba08267 100644 | |||
174 | --- a/tests/unit/files/haproxy_config_rendered_test_output.txt | |||
175 | +++ b/tests/unit/files/haproxy_config_rendered_test_output.txt | |||
176 | @@ -126,6 +126,7 @@ backend backend-site1-local | |||
177 | 126 | backend backend-site2-local | 126 | backend backend-site2-local |
178 | 127 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 127 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
179 | 128 | http-request set-header Host site2.local | 128 | http-request set-header Host site2.local |
180 | 129 | http-request set-header X-Forwarded-For %[src] | ||
181 | 129 | balance leastconn | 130 | balance leastconn |
182 | 130 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 131 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
183 | 131 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 132 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
184 | diff --git a/tests/unit/files/haproxy_config_rendered_test_output2.txt b/tests/unit/files/haproxy_config_rendered_test_output2.txt | |||
185 | index 22c56ab..a5b3d08 100644 | |||
186 | --- a/tests/unit/files/haproxy_config_rendered_test_output2.txt | |||
187 | +++ b/tests/unit/files/haproxy_config_rendered_test_output2.txt | |||
188 | @@ -126,6 +126,7 @@ backend backend-site1-local | |||
189 | 126 | backend backend-site2-local | 126 | backend backend-site2-local |
190 | 127 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 127 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
191 | 128 | http-request set-header Host site2.local | 128 | http-request set-header Host site2.local |
192 | 129 | http-request set-header X-Forwarded-For %[src] | ||
193 | 129 | balance leastconn | 130 | balance leastconn |
194 | 130 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 131 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
195 | 131 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 132 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
196 | diff --git a/tests/unit/files/haproxy_config_rendered_test_output_with_extra_configs.txt b/tests/unit/files/haproxy_config_rendered_test_output_with_extra_configs.txt | |||
197 | index 7166d28..0ec24fa 100644 | |||
198 | --- a/tests/unit/files/haproxy_config_rendered_test_output_with_extra_configs.txt | |||
199 | +++ b/tests/unit/files/haproxy_config_rendered_test_output_with_extra_configs.txt | |||
200 | @@ -126,6 +126,7 @@ backend backend-site1-local | |||
201 | 126 | backend backend-site2-local | 126 | backend backend-site2-local |
202 | 127 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk | 127 | option httpchk GET /check/ HTTP/1.1\r\nHost:\ site2.local\r\nUser-Agent:\ haproxy/httpchk |
203 | 128 | http-request set-header Host site2.local | 128 | http-request set-header Host site2.local |
204 | 129 | http-request set-header X-Forwarded-For %[src] | ||
205 | 129 | balance leastconn | 130 | balance leastconn |
206 | 130 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 131 | server server_1 127.0.1.10:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
207 | 131 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt | 132 | server server_2 127.0.1.11:443 check inter 5s rise 2 fall 5 maxconn 1024 ssl sni str(site2.local) check-sni site2.local verify required ca-file ca-certificates.crt |
208 | diff --git a/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt b/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt | |||
209 | index 6264b6e..b3392bd 100644 | |||
210 | --- a/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt | |||
211 | +++ b/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt | |||
212 | @@ -43,6 +43,20 @@ server { | |||
213 | 43 | root /var/www/html; | 43 | root /var/www/html; |
214 | 44 | } | 44 | } |
215 | 45 | 45 | ||
216 | 46 | |||
217 | 47 | location /.well-known/matrix/server { | ||
218 | 48 | proxy_cache 9813f9fe7826-cache; | ||
219 | 49 | add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0"; | ||
220 | 50 | return 200 '{"m.server": "chat-server.ubuntu.com:443"}'; | ||
221 | 51 | } | ||
222 | 52 | |||
223 | 53 | |||
224 | 54 | location /.well-known/matrix/client { | ||
225 | 55 | proxy_cache 9813f9fe7826-cache; | ||
226 | 56 | add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0"; | ||
227 | 57 | return 200 '{"m.homeserver": {"base_url": "https://chat-server.ubuntu.com"}}'; | ||
228 | 58 | } | ||
229 | 59 | |||
230 | 46 | location /_status/content-cache-check { | 60 | location /_status/content-cache-check { |
231 | 47 | stub_status; | 61 | stub_status; |
232 | 48 | } | 62 | } |
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.