diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-09-07 13:05:29 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-09-07 13:05:29 +0200 |
commit | 8d59b1ac456575496e0bceb6812c59545b1e9b50 (patch) | |
tree | 02adc9e2c3d170f97ee7ef5e9cc01d6e6e139c8c /lib/support | |
parent | 0fbd6244ec8d06376b4130a4832dd77ce207fc5f (diff) | |
download | gitlab-ce-8d59b1ac456575496e0bceb6812c59545b1e9b50.tar.gz |
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).
Diffstat (limited to 'lib/support')
-rw-r--r-- | lib/support/nginx/gitlab | 7 | ||||
-rw-r--r-- | lib/support/nginx/gitlab-ssl | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab index 17f89c8beb6..1cd81ea769f 100644 --- a/lib/support/nginx/gitlab +++ b/lib/support/nginx/gitlab @@ -124,6 +124,13 @@ server { proxy_connect_timeout 300; proxy_redirect off; + # Do not buffer Git HTTP responses + proxy_buffering off; + + # 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..83aad321aab 100644 --- a/lib/support/nginx/gitlab-ssl +++ b/lib/support/nginx/gitlab-ssl @@ -171,6 +171,13 @@ server { proxy_connect_timeout 300; proxy_redirect off; + # Do not buffer Git HTTP responses + proxy_buffering off; + + # 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; |