mholt / caddy-ratelimit

HTTP rate limiting module for Caddy 2
Apache License 2.0
255 stars 17 forks source link

Need guide #2

Closed ermiaqasemi closed 3 years ago

ermiaqasemi commented 3 years ago

Hey there,

How can I enable this just for a specific route?

` route /api/gateway/* {

Just wanna rate limit here

    # I wanna allow user to send 100 req per min 

    rewrite * /graphql
    reverse_proxy http://tribe-gateway.development.svc.cluster.local
}

` Thanks!

ermiaqasemi commented 3 years ago

I make it work but when adding rate limit to route it throws CORS issue I already tried this but not work,

header Access-Control-Allow-Origin "*" header Access-Control-Allow-Methods "GET, POST, OPTIONS" header Access-Control-Allow-Credentials true

mholt commented 3 years ago

Seems you have figured it out... in that case I'll close the issue. If you have further questions (about CORS, or whatever else unrelated to rate limiting) please ask on the forums: https://caddy.community - thanks!