From 730f0ea69aa2ede3fa512da34ea1de507f62a5a2 Mon Sep 17 00:00:00 2001 From: Deimos Date: Sat, 29 Jun 2019 14:30:47 -0600 Subject: [PATCH] Only apply nginx ratelimit in prod This is interfering with a few things in dev, including the debug toolbar (since all of its assets are served by the app). --- salt/salt/nginx/tildes.conf.jinja2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/salt/nginx/tildes.conf.jinja2 b/salt/salt/nginx/tildes.conf.jinja2 index 5b383a6..29ae9ab 100644 --- a/salt/salt/nginx/tildes.conf.jinja2 +++ b/salt/salt/nginx/tildes.conf.jinja2 @@ -73,8 +73,10 @@ server { } location @proxy_to_app { + {% if grains["id"] == "prod" %} # apply rate-limiting, allowing a burst above the limit limit_req zone=tildes_app burst=5 nodelay; + {% endif -%} # Cornice adds the X-Content-Type-Options header, so it will end up # being duplicated since nginx is also configured to send it (above).