Hello Viet, I posted the same question on Digital Ocean forums and got a response suggesting to intercept errors from upstream and to rate limit based on the error using the `error_page` directive. I haven't tried it myself yet but it's worth a shot. Here's a link to the full post: https://www.digitalocean.com/community/questions/use-nginx-to-rate-limit-only-when-origin-server-response-code-is-by veerareddy - Nginx Mailing List - English
![]() |
![]() |
![]() |
![]() |
![]() |