File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed
charts/matrix-stack/configs Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ defaults
2626
2727 log global
2828
29+ # The Ingress Controller should appropriately set an X-Forwarded-For header
30+ # We leave it alone if it has, but add in the source address in cases where it hasn't
31+ # or the request hasn't come from the ingress controller (i.e. in-cluster)
32+ option forwardfor if-none
33+
34+ # Set the RFC7239 `Forwarded` header
35+ option forwarded
36+
2937 # wait for 5s when connecting to a server
3038 timeout connect 5s
3139
Original file line number Diff line number Diff line change @@ -39,21 +39,6 @@ frontend synapse-http-in
3939 http-request capture req.fhdr(x-forwarded-for) len 64
4040 http-request capture req.fhdr(user-agent) len 200
4141
42- # before we change the 'src', stash it in a session variable
43- http-request set-var(sess.orig_src) src if !{ var(sess.orig_src) -m found }
44-
45- # in case this is not the first request on the connection, restore the
46- # 'src' to the original, in case we fail to parse the x-f-f header.
47- http-request set-src var(sess.orig_src)
48-
49- # Traditionally do this only for traffic from some limited IP addreses
50- # but the incoming router being what it is, means we have no fixed IP here.
51- http-request set-src hdr(x-forwarded-for)
52-
53- # We always add a X-Forwarded-For header (clobbering any existing
54- # headers).
55- http-request set-header X-Forwarded-For %[src]
56-
5742 # Ingresses by definition run on both 80 & 443 and there's no customising of that
5843 # It is up to the ingress controller and any annotations provided to it whether
5944 # it sets any additional headers or not or whether it redirects http -> https
Original file line number Diff line number Diff line change 1+ Correct the handling of multiple X-Forwarded-For headers to Synapse.
2+
3+ This may have exhibit itself as requests being incorrectly rate-limited by Synapse.
4+
5+ The source IP logged by HAProxy is now always the IP connecting to HAProxy rather than
6+ a value extracted from the X-Forwarded-For header (if present). This is usually an IP
7+ for the ingress controller.
You can’t perform that action at this time.
0 commit comments