Got 502 from bouncer to LAPI when enabling trusted_ips and use_forwarded_for_headers
Hello
i'm running crowdsec on rootless podman, the LAPI is behind a caddy reverse proxy (also running in a container).
All is working fine, but one thing is not very clean, when i enroll a bouncer, i got the IP of caddy and not the ip of the host where is installed the bouncer. So that's why i try to change the config.yaml by enabling the two settings: use_forwarded_for_headers to true and trusted_ips.
But with this 2 new settings now i get a 502 and the bouncer can't contact the LAPI.
config.yaml look like this :
the Caddyfile look like this :
the error log in caddy :
How can i have the real IP of the bouncer and not getting the 502 ?
4 Replies
Important Information
This post has been marked as resolved. If this is a mistake please press the red button below or type
/unresolve
© Created By WhyAydan for CrowdSec ❤️
so
use_forwarded_for_headers: true
enables the use of X-Forwarded-For
headers so you need to send that header. Do you have any logs inside crowdsec itself?I activate the debug level for logging but I didn’t find something on crowdsec.log or crowdsec_api.log
i found the error, when mounting the config file, by default LAPI listen on 127.0..0.1, thats why caddy couldn't redirect the http request from the bouncer
Resolving Got 502 from bouncer to LAPI when enabling trusted_ips and use_forwarded_for_headers
This has now been resolved. If you think this is a mistake please run
/unresolve