summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-06-28 13:44:42 -0400
committerDessalines <tyhou13@gmx.com>2020-06-28 13:44:42 -0400
commit0112d0d9551836c1a525203a8fef27c94e640405 (patch)
treeff1ec29b8cd85caa5758b19166399a695af9a53b /ansible
parent6672cbc253e1b8d04a60cd34c2f58cf0d12efb13 (diff)
Fixing test deploy, adding a rate limiter to ansible nginx config.
Diffstat (limited to 'ansible')
-rw-r--r--ansible/templates/nginx.conf4
1 files changed, 4 insertions, 0 deletions
diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf
index b710fdb3..5847bad0 100644
--- a/ansible/templates/nginx.conf
+++ b/ansible/templates/nginx.conf
@@ -1,4 +1,5 @@
proxy_cache_path /var/cache/lemmy_frontend levels=1:2 keys_zone=lemmy_frontend_cache:10m max_size=100m use_temp_path=off;
+limit_req_zone $binary_remote_addr zone=lemmy_ratelimit:10m rate=1r/s;
server {
listen 80;
@@ -51,6 +52,9 @@ server {
# Upload limit for pictrs
client_max_body_size 20M;
+ # Rate limit
+ limit_req zone=lemmy_ratelimit burst=30 nodelay;
+
location / {
proxy_pass http://0.0.0.0:8536;
proxy_set_header X-Real-IP $remote_addr;