You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by is...@apache.org on 2022/11/02 11:33:29 UTC

[airavata-custos] branch baremetal updated: implement nginx rate limiting

This is an automated email from the ASF dual-hosted git repository.

isjarana pushed a commit to branch baremetal
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git


The following commit(s) were added to refs/heads/baremetal by this push:
     new 78244114d implement nginx rate limiting
     new fe0d8e25f Merge pull request #317 from isururanawaka/baremetal
78244114d is described below

commit 78244114d94051be7f1b7d906e5f88be0a0ffef1
Author: Isuru Ranawaka <ir...@gmail.com>
AuthorDate: Wed Nov 2 07:32:54 2022 -0400

    implement nginx rate limiting
---
 ansible/roles/env_setup/templates/custos/nginx.conf.j2    | 8 ++++++++
 ansible/roles/env_setup/templates/hashicorp/nginx.conf.j2 | 6 ++++++
 ansible/roles/env_setup/templates/keycloak/nginx.conf.j2  | 6 ++++++
 3 files changed, 20 insertions(+)

diff --git a/ansible/roles/env_setup/templates/custos/nginx.conf.j2 b/ansible/roles/env_setup/templates/custos/nginx.conf.j2
index 706278c7c..587b9753f 100644
--- a/ansible/roles/env_setup/templates/custos/nginx.conf.j2
+++ b/ansible/roles/env_setup/templates/custos/nginx.conf.j2
@@ -41,10 +41,18 @@ http {
 	access_log /var/log/nginx/access.log;
 	error_log /var/log/nginx/error.log;
 
+	##
+	#Rate Lmiting
+	##
+	limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
+	limit_req zone=mylimit burst=20 nodelay;
+
+
 	##
 	# Gzip Settings
 	##
 
+
 	gzip on;
 
 	# gzip_vary on;
diff --git a/ansible/roles/env_setup/templates/hashicorp/nginx.conf.j2 b/ansible/roles/env_setup/templates/hashicorp/nginx.conf.j2
index 706278c7c..076beddca 100644
--- a/ansible/roles/env_setup/templates/hashicorp/nginx.conf.j2
+++ b/ansible/roles/env_setup/templates/hashicorp/nginx.conf.j2
@@ -41,6 +41,12 @@ http {
 	access_log /var/log/nginx/access.log;
 	error_log /var/log/nginx/error.log;
 
+   	##
+   	# Rate Lmiting
+   	##
+   	limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
+   	limit_req zone=mylimit burst=20 nodelay;
+
 	##
 	# Gzip Settings
 	##
diff --git a/ansible/roles/env_setup/templates/keycloak/nginx.conf.j2 b/ansible/roles/env_setup/templates/keycloak/nginx.conf.j2
index 706278c7c..b9c146682 100644
--- a/ansible/roles/env_setup/templates/keycloak/nginx.conf.j2
+++ b/ansible/roles/env_setup/templates/keycloak/nginx.conf.j2
@@ -41,6 +41,12 @@ http {
 	access_log /var/log/nginx/access.log;
 	error_log /var/log/nginx/error.log;
 
+	##
+	# Rate Lmiting
+	##
+	limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
+	limit_req zone=mylimit burst=20 nodelay;
+
 	##
 	# Gzip Settings
 	##