From f4ab6ad116472a8b18349966feacb359c4ab7b61 Mon Sep 17 00:00:00 2001 From: RAM PRASAD ATLURI <116977270+ATLURI0001@users.noreply.github.com> Date: Sun, 15 Nov 2026 21:14:12 +0530 Subject: [PATCH] feat(edge): configure slowloris timeouts, reset timed out sockets, and enable proxy sni --- nginx/nginx.conf | 4 ++++ nginx/snippets/proxy.conf | 1 + tests/test_project.py | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 6a5a962..5880cc4 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -14,6 +14,10 @@ http { sendfile on; tcp_nopush on; keepalive_timeout 65; + client_body_timeout 15s; + client_header_timeout 15s; + send_timeout 15s; + reset_timedout_connection on; server_tokens off; client_max_body_size 10m; client_body_buffer_size 128k; diff --git a/nginx/snippets/proxy.conf b/nginx/snippets/proxy.conf index b524ca4..cc3afc9 100644 --- a/nginx/snippets/proxy.conf +++ b/nginx/snippets/proxy.conf @@ -1,4 +1,5 @@ proxy_http_version 1.1; +proxy_ssl_server_name on; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/tests/test_project.py b/tests/test_project.py index 2e91dc4..4000be9 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -142,5 +142,15 @@ def test_trace_id_propagation_in_demo_app(self): self.assertIn('data["requestId"] = req_id', source) self.assertIn('"X-Request-ID": req_id', source) + def test_slowloris_timeouts_and_socket_resets(self): + cfg = load('nginx/nginx.conf') + self.assertIn('client_body_timeout 15s;', cfg) + self.assertIn('client_header_timeout 15s;', cfg) + self.assertIn('send_timeout 15s;', cfg) + self.assertIn('reset_timedout_connection on;', cfg) + + proxy = load('nginx/snippets/proxy.conf') + self.assertIn('proxy_ssl_server_name on;', proxy) + if __name__ == '__main__': unittest.main()