From fc6472e92e9dd6fe5c50238ad52702c9d0125d89 Mon Sep 17 00:00:00 2001 From: Arpith Varghese Date: Fri, 20 Sep 2024 15:30:19 -0700 Subject: [PATCH] update config --- .../with-web-application-firewall/main.tf | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/terraform/deployments/with-web-application-firewall/main.tf b/terraform/deployments/with-web-application-firewall/main.tf index 6b5e242..1b6d0e6 100644 --- a/terraform/deployments/with-web-application-firewall/main.tf +++ b/terraform/deployments/with-web-application-firewall/main.tf @@ -57,6 +57,8 @@ worker_processes auto; worker_rlimit_nofile 8192; pid /run/nginx/nginx.pid; +load_module modules/ngx_http_app_protect_module.so; + events { worker_connections 4000; } @@ -64,11 +66,20 @@ events { error_log /var/log/nginx/error.log error; http { + app_protect_enforcer_address 127.0.0.1:50000; + server { listen 80 default_server; - server_name localhost; + location / { - return 200 'Hello World'; + app_protect_enable on; + app_protect_policy_file /etc/app_protect/conf/NginxDefaultPolicy.tgz; + proxy_pass http://127.0.0.1:80/proxy/$request_uri; + } + + location /proxy { + default_type text/html; + return 200 "Hello World\n"; } } }