Bridge ingress (Docker's docker-proxy userland forwarder, Podman's slirp4netns/pasta) rewrites the source IP of inbound connections on a published port to the bridge gateway address. HAProxy then stamps that gateway address into the PROXY v2 header it forwards to mtg and Caddy, so neither backend ever sees a real client IP. Move HAProxy into the host netns (network_mode: host) so it binds :443/:80 directly with no NAT in the path. mtg and Caddy stay on the compose bridge and are published on 127.0.0.1 only; HAProxy reaches them via host loopback and PROXY v2 carries the real client IP (v4 or v6) end-to-end. Also accept IPv6 clients explicitly on the HAProxy frontends — `bind *:443` is IPv4-only and missed v6 clients on hosts where the previous example happened to "work" only because of dual-stack quirks. Add 127.0.0.0/8 to Caddy's PROXY allow-list to cover the new loopback hop from HAProxy. README gains a short subsection explaining the host-mode choice and its trade-off (HAProxy occupies host :443/:80). Diagnosed and tested by @bam80 on Fedora + Docker 29. Fixes #498.pull/522/head
|
|
||
| 10 |
|
10 |
|
| 11 |
|
11 |
|
| 12 |
|
12 |
|
| 13 |
|
|
|
| 14 |
|
|
|
| 15 |
|
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
| 16 |
|
18 |
|
| 17 |
|
19 |
|
| 18 |
|
20 |
|
| 19 |
|
21 |
|
| 20 |
|
|
|
|
22 |
|
|
| 21 |
|
23 |
|
| 22 |
|
24 |
|
| 23 |
|
25 |
|
|
|
||
| 63 |
|
63 |
|
| 64 |
|
64 |
|
| 65 |
|
65 |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
| 66 |
|
86 |
|
| 67 |
|
87 |
|
| 68 |
|
88 |
|
|
|
||
| 27 |
|
27 |
|
| 28 |
|
28 |
|
| 29 |
|
29 |
|
| 30 |
|
|
|
| 31 |
|
|
|
| 32 |
|
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
| 33 |
|
40 |
|
| 34 |
|
41 |
|
| 35 |
|
42 |
|
|
|
||
| 38 |
|
45 |
|
| 39 |
|
46 |
|
| 40 |
|
47 |
|
| 41 |
|
|
|
| 42 |
|
|
|
| 43 |
|
48 |
|
| 44 |
|
49 |
|
| 45 |
|
50 |
|
| 46 |
|
51 |
|
| 47 |
|
52 |
|
| 48 |
|
53 |
|
| 49 |
|
|
|
| 50 |
|
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
| 51 |
|
58 |
|
| 52 |
|
59 |
|
| 53 |
|
60 |
|
|
|
||
| 58 |
|
65 |
|
| 59 |
|
66 |
|
| 60 |
|
67 |
|
| 61 |
|
|
|
| 62 |
|
|
|
| 63 |
|
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
| 64 |
|
72 |
|
| 65 |
|
73 |
|
| 66 |
|
74 |
|
|
|
||
| 23 |
|
23 |
|
| 24 |
|
24 |
|
| 25 |
|
25 |
|
| 26 |
|
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
| 27 |
|
31 |
|
| 28 |
|
32 |
|
| 29 |
|
33 |
|
|
|
||
| 35 |
|
39 |
|
| 36 |
|
40 |
|
| 37 |
|
41 |
|
| 38 |
|
|
|
|
42 |
|
|
|
43 |
|
|
| 39 |
|
44 |
|
| 40 |
|
45 |
|
| 41 |
|
46 |
|
|
|
||
| 46 |
|
51 |
|
| 47 |
|
52 |
|
| 48 |
|
53 |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
| 49 |
|
59 |
|
| 50 |
|
60 |
|
| 51 |
|
61 |
|
| 52 |
|
62 |
|
| 53 |
|
|
|
|
63 |
|
|
| 54 |
|
64 |
|
| 55 |
|
65 |
|
| 56 |
|
66 |
|
| 57 |
|
67 |
|
| 58 |
|
68 |
|
| 59 |
|
|
|
|
69 |
|
|
| 60 |
|
70 |
|
| 61 |
|
71 |
|
| 62 |
|
72 |
|
| 63 |
|
|
|
|
73 |
|