src.nth.io/

summaryrefslogtreecommitdiff
path: root/dendrite/server/templates/nginx.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'dendrite/server/templates/nginx.conf.j2')
-rw-r--r--dendrite/server/templates/nginx.conf.j27
1 files changed, 7 insertions, 0 deletions
diff --git a/dendrite/server/templates/nginx.conf.j2 b/dendrite/server/templates/nginx.conf.j2
index 8e2d34f..aa7125c 100644
--- a/dendrite/server/templates/nginx.conf.j2
+++ b/dendrite/server/templates/nginx.conf.j2
@@ -1,3 +1,5 @@
+limit_req_zone $binary_remote_addr zone=dendrite_reg:10m rate=2r/m;
+
server {
listen 80;
server_name {{nginx_server_name}};
@@ -36,6 +38,11 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600;
+ location ~* ^/_matrix/client/[^/]+/register {
+ limit_req zone=dendrite_reg burst=3 nodelay;
+ proxy_pass http://127.0.0.1:{{nginx_proxy_port}};
+ }
+
location /_matrix {
proxy_pass http://127.0.0.1:{{nginx_proxy_port}};
}