-
Notifications
You must be signed in to change notification settings - Fork 17
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
using with trusted_proxies / behind another proxy #19
Comments
I'm not sure I understand the question -- can you elaborate? And maybe share your config, the problem, etc? |
Hey, sorry let me try and explain better, I am trying to use this plugin to rate limit users to our landing pages, the issue I am having is that the rate limit is applied to everyone as we use caddy behind a proxy / CDN we get the wrong IP. I am pretty sure it is related to caddyserver/caddy#4924 Here is my rate limit config
The key here will be one of Cloudflare's IPs and so we rate limit multiple users. Thanks |
Oh, yes I think that is related. You could also use the X-Forwarded-For header (if you trust that your clients are all coming from your CDN). @francislavoie might actually have more expertise with this. |
I think once caddyserver/caddy#5103 is merged, this plugin could inherit from that functionality to get the "real client IP". For now, there's no "safe" way of doing it for this plugin on its own. The |
👋 hey @francislavoie so looks like we are on the last part of this and we will soon be able to use
Might see if I can build from this branch and see if i can get it working |
That's right. There's no |
cool, no worries it looks good to me anyways cant wait to test it out 👍 |
I believe this got merged in now if you want to try it (requires latest on master, as it's unreleased still). |
Thanks for your work on this, I am looking to implement this plugin to stop spam at the caddy level and rate limiting seems to be the best thing to do.
I am having an issue whereby the limits work but they will rate limit all requests with placeholder remote_host, I believe this is because its outside of the reverse_proxy handler and so trusted_proxies does not run before rate_limit
Is there a way to accomplish this?
The text was updated successfully, but these errors were encountered: