Allow configuring Nginx->Workhorse proxy buffer size

Summary

Per gitlab#351181 (closed), when using Geo proxying, we would replay the header from the primary in Workhorse, which can get pretty large in some cases, i.e. over 4k on the staging Geo site.

Proposal

We could configure the proxy_buffers and proxy_buffer_size to override the defaults (default == 1 pagesize) to allow for larger headers.

One possible patch would be something like the below, and adding a nginx[] config item for the buffer size:

diff --git a/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb b/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
index 5d871af2e..801ad5643 100644
--- a/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
+++ b/files/gitlab-cookbooks/gitlab/templates/default/nginx-gitlab-http.conf.erb
@@ -194,6 +194,8 @@ server {
   location <%= @path %> {
     proxy_cache off;
     proxy_pass  http://gitlab-workhorse;
+    <% if @custom_buffer_size -%>
+    proxy_buffers 8 @custom_proxy_buffer_size;
+    proxy_buffer_size @custom_proxy_buffer_size;
+    <% end -%>
   }
 
   location <%= File.join(@path, 'assets') %> {

References

gitlab#351181 (closed)