mholt/caddy-ratelimit

Need guide

ermiaqasemi opened this issue · 2 comments

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!

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

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!