From be29f1228c0ba862fbb572862678b99d2600bb62 Mon Sep 17 00:00:00 2001
From: Eric Frias <efrias@syncad.com>
Date: Sat, 21 Dec 2024 17:49:18 -0500
Subject: [PATCH] Force nginx to parse and store the request body in a way that
 it can be logged

---
 drone/nginx.conf | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drone/nginx.conf b/drone/nginx.conf
index df0441d..d37b4fe 100644
--- a/drone/nginx.conf
+++ b/drone/nginx.conf
@@ -49,13 +49,16 @@ http {
     server_name _;
 
     location / {
-      access_log /var/log/drone/access_log api_log buffer=32k flush=5s;
+      #access_log /var/log/drone/access_log api_log buffer=32k flush=5s;
       # switch to this to log in jsonl format instead
       access_log /var/log/drone/access_log.json json_log buffer=32k flush=5s;
       proxy_pass http://drone;
       # Allow fast streaming HTTP/1.1 pipes (keep-alive, unbuffered)
       proxy_http_version 1.1;
-      proxy_request_buffering off;
+
+      client_body_buffer_size 128k; # Adjust size as needed
+      proxy_request_buffering on;
+      client_body_in_single_buffer on;
       proxy_buffering off;
       #proxy_set_header forwarded 'by=\"_$hostname\";$for_addr;proto=$scheme;host=\"$http_host\"';
     }
-- 
GitLab