Use 429 error code for nginx ratelimiting
authorriking <rikingcoding@gmail.com>
Fri, 7 Nov 2014 17:26:20 +0000 (09:26 -0800)
committerriking <rikingcoding@gmail.com>
Fri, 7 Nov 2014 17:26:20 +0000 (09:26 -0800)
templates/web.ratelimited.template.yml

index 432d3cb23f635f550cdffc6798be66994d7f0e3d..8074da5c44160c19a79f08e5d5f67564b7aa655a 100644 (file)
@@ -11,6 +11,7 @@ run:
      to: |
        limit_req_zone $binary_remote_addr zone=flood:10m rate=$reqs_per_secondr/s;
        limit_req_zone $binary_remote_addr zone=bot:10m rate=$reqs_per_minuter/m;
+       limit_req_status 429;
        server {
   - replace:
      filename: "/etc/nginx/conf.d/discourse.conf"