Commit 8d59b1ac authored by Jacob Vosmaer's avatar Jacob Vosmaer

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).
parent 0fbd6244
...@@ -124,6 +124,13 @@ server { ...@@ -124,6 +124,13 @@ server {
proxy_connect_timeout 300; proxy_connect_timeout 300;
proxy_redirect off; 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 Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......
...@@ -171,6 +171,13 @@ server { ...@@ -171,6 +171,13 @@ server {
proxy_connect_timeout 300; proxy_connect_timeout 300;
proxy_redirect off; 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 Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Ssl on;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment