Search code examples
node.jsnginxheroku

How to configure nginx for heroku nodejs web application


How does one configure nginx for a heroku nodejs web application? I would like to configure nginx such that an IP address is limited to N requests for a given time period. Like the classic "You're doing that too much" message as seen on Reddit.

Thanks,

Charles


Solution

  • 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.