Is there are a way to enable rate limiting only for successful requests (i.e. HTTP status code 200)?
For example, in the following snippet from my configuration...
http {
limit_req_zone $binary_remote_addr zone=test:10m rate=2r/m;
server {
location / {
limit_req zone=test;
proxy_pass http://localhost:3000/;
...
}
...
}
...
}
...requests are successfully rate limited (up to two requests per minute).
However, as this is for a contact form which sends me emails, I do not care about rate limiting if http://localhost:3000/
returns an error as no email will have been sent.