Skip to content

[BUG] BunkerWeb bans CDN IP instead of real client IP #2248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
hesamgholami opened this issue May 7, 2025 · 1 comment
Open
2 tasks done

[BUG] BunkerWeb bans CDN IP instead of real client IP #2248

hesamgholami opened this issue May 7, 2025 · 1 comment
Assignees
Labels
bug Something isn't working need more info

Comments

@hesamgholami
Copy link

hesamgholami commented May 7, 2025

What happened?

I want to block clients based on bad behavior using their real IP addresses. I enabled USE_REAL_IP in BunkerWeb and configured the real IP header to use the X-Forwarded-For value. However, BunkerWeb still bans the IP address of the CDN instead of the actual client's IP.

I checked the requests coming from the CDN, and I can confirm that the real client IP is present in the X-Forwarded-For header.

How to reproduce?

  1. Deploy BunkerWeb behind a CDN.

  2. Enable USE_REAL_IP in the BunkerWeb configuration.

  3. Set the real IP source to X-Forwarded-For.

  4. Trigger a ban condition (e.g., repeated failed requests).

  5. Observe that the banned IP is the CDN's IP, not the client's IP.

Configuration file(s) (yaml or .env)

Relevant log output

BunkerWeb version

1.5.9

What integration are you using?

Linux

Linux distribution (if applicable)

Debian 12

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@hesamgholami hesamgholami added the bug Something isn't working label May 7, 2025
@TheophileDiot
Copy link
Member

Hi @hesamgholami, thanks for opening this issue! It looks like the problem might be related to your real IP configuration. Let us know if you need help checking or updating it.
https://docs.bunkerweb.io/1.5/quickstart-guide/#behind-load-balancer-or-reverse-proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info
Projects
None yet
Development

No branches or pull requests

2 participants