summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-09 09:07:06 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-09 09:07:06 +0000
commit5ff84deb3a852c6d2c88b8ded64213a26784b822 (patch)
treecd2b18e4938288ae59fa2ebd3ae3088467fb84e9
parente8c8feb4b3235e5f5c2001c04e44f118965b3768 (diff)
parent783791fd08e8144a2ab97307a12df9d2a40e0421 (diff)
downloadgitlab-ce-5ff84deb3a852c6d2c88b8ded64213a26784b822.tar.gz
Merge branch 'nginx-git-http' into 'master'
Do not let NGINX buffer Git HTTP requests Before this change NGINX would convert a chunked HTTP POST (e.g. git push) into a HTTP 1.0 single large POST. This creates an unnecessary delay, and it creates unnecessary memory pressure on gitlab-git-http-server. For the response ('proxy_buffering') I am less sure that NGINX 's buffering behavior is harmful, but it still makes more sense to me not to interfere with gitlab-git-http-server (and the Golang net/http server). See merge request !1256
-rw-r--r--lib/support/nginx/gitlab9
-rw-r--r--lib/support/nginx/gitlab-ssl9
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab
index 17f89c8beb6..7218a4d2f20 100644
--- a/lib/support/nginx/gitlab
+++ b/lib/support/nginx/gitlab
@@ -124,6 +124,15 @@ server {
proxy_connect_timeout 300;
proxy_redirect off;
+ # Do not buffer Git HTTP responses
+ proxy_buffering off;
+
+ # The following settings only work with NGINX 1.7.11 or newer
+ #
+ # # Pass chunked request bodies to gitlab-git-http-server as-is
+ # proxy_request_buffering off;
+ # proxy_http_version 1.1;
+
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl
index 5ba39fc41a4..7dabfba87e2 100644
--- a/lib/support/nginx/gitlab-ssl
+++ b/lib/support/nginx/gitlab-ssl
@@ -171,6 +171,15 @@ server {
proxy_connect_timeout 300;
proxy_redirect off;
+ # Do not buffer Git HTTP responses
+ proxy_buffering off;
+
+ # The following settings only work with NGINX 1.7.11 or newer
+ #
+ # # Pass chunked request bodies to gitlab-git-http-server as-is
+ # proxy_request_buffering off;
+ # proxy_http_version 1.1;
+
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;