Skip to content
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

rate_limit does not trigger #21

Open
UltraBlackLinux opened this issue Mar 7, 2024 · 5 comments
Open

rate_limit does not trigger #21

UltraBlackLinux opened this issue Mar 7, 2024 · 5 comments

Comments

@UltraBlackLinux
Copy link

Hey there,
I'm trying to protect a basicauth prompt against brute-forcing using rate_limit, but for some reason it just does not trigger. I can curl the path all day long and it will not even once return a 429. Here's my config:

handle_path /test {
  rate_limit {query.id} 1r/m
  basicauth {
    something something
  }
  reverse_proxy ...
 }

any idea why?

@Hor1kon
Copy link

Hor1kon commented Jul 3, 2024

same problem, did you find a solution?

@UltraBlackLinux
Copy link
Author

@Hor1kon I switched to this: https://github.com/mholt/caddy-ratelimit
it's working fine

@decaf-dev
Copy link

decaf-dev commented Jul 4, 2024

@Hor1kon This is working for me

    handle /login {
        rate_limit {remote.host} 10r/m
        reverse_proxy my-app:3000 {
            header_up X-Real-IP {remote_host}
        }
    }

I had to add an order block at the top of my Caddy file

{
	order rate_limit before basicauth
}

Also, make sure that the network request that you are trying to block actually matches the path that you have in your handle.

@Hor1kon
Copy link

Hor1kon commented Jul 5, 2024

@Hor1kon I switched to this: https://github.com/mholt/caddy-ratelimit it's working fine

Yea, I also have switched to it

@Hor1kon
Copy link

Hor1kon commented Jul 5, 2024

@Hor1kon This is working for me

    handle /login {
        rate_limit {remote.host} 10r/m
        reverse_proxy my-app:3000 {
            header_up X-Real-IP {remote_host}
        }
    }

I had to add an order block at the top of my Caddy file

{
	order rate_limit before basicauth
}

Also, make sure that the network request that you are trying to block actually matches the path that you have in your handle.

Yeah, I think by me it wasn't working because of this first line, because in other rate-limit build this line was initially in the example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants