How to configure nginx for heroku nodejs web application
Good starting point : heroku/heroku-buildpack-nginx
What you are looking for is rate-limiting with NGINX, read this for a better understanding
and here you have an example gist: NGINX reverse proxy with rate limiting
This is the file of the heroku-nginx-node-example that I think you have to add the limit_req options
If you need more help, show what you have tried so far and I will edit this answer.