Correct rate limiting stuff
authorSam <sam.saffron@gmail.com>
Mon, 25 Aug 2014 06:42:10 +0000 (16:42 +1000)
committerSam <sam.saffron@gmail.com>
Mon, 25 Aug 2014 06:42:10 +0000 (16:42 +1000)
samples/standalone.yml
templates/web.ratelimited.template.yml

index 8b461cc35967716403bbb0d8338e4790c975242c..4671e0768d4adf581d8fdcb33ee65336027a6f2e 100644 (file)
@@ -6,11 +6,17 @@
 ##
 
 ## this is the all-in-one, standalone Discourse Docker container template
+
+# You may add rate limiting to by commenting out the ratelimited template.
+# Out of the box it allows 12 reqs a second per ip, and 100 per minute per ip
+# This is configurable by amending the params in this file
+
 templates:
   - "templates/postgres.template.yml"
   - "templates/redis.template.yml"
   - "templates/web.template.yml"
   - "templates/sshd.template.yml"
+  #- "templates/web.ratelimited.template.yml"
 
 ## which TCP/IP ports should this container expose?
 expose:
index fe7a5e30f291b048b48b41fbf97c28051abd1725..8e83cf526041d77bb84abcc2a7ae7255cb1cd348 100644 (file)
@@ -9,8 +9,8 @@ run:
      filename: "/etc/nginx/conf.d/discourse.conf"
      from: /server.+{/
      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_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;
        server {
   - replace:
      filename: "/etc/nginx/conf.d/discourse.conf"