We provide some JSON Web APIs. Users can create API key on our web page then use the key as HTTP header attribute. However, we will allow to access without the key for trial use. In this case, how can we set up nginx configuration?
sample request
curl -H 'x-api-key:xxxx' https://api.xxx.com/xxx
We need to set up both (1) and (2)
(1) Without 'x-api-key' http header -> limit_req setting (e.g 10 request per sec)
(2) With 'x-api-key' http header -> no limitation.
Update 1
This is almost same question.