Because limit_req_zone
must be specified in HTTP context and cannot be in server
or even in location
context, it seems one can only set a rate limit for the entire server.
Nginx is used to serve static files and one may do this as often as they like. However, the /api/...
path is proxied to the application server and should not be hit with a DoS attack. How can I configure Nginx to only rate limit the API?