Invalid status for PUT behind a proxy - git lfs


#1

I was able to get git lfs working with a local test gitlab-ce virtual machine, but when attempting to get it working on our server (behind a reverse proxy) I am having issues. We are currently set up as follows; Browser <--https--> RP <--http--> GL server. In the gitlab settings I have the external URL set to http, otherwise it will not work (we do not have the GL server serving https). The RP redirects all requests to https. When I attempt to push LFS files to the gitlab server I am getting a message stating

Git LFS: (1 of 1 files) 1.93 MB / 1.93 MB

Invalid status for PUT http://our-gl-domain-name.com/Ben/ben-test.git/gitlab-lfs/objects/02...927: 301
  1. am I correct in interpretting that git lfs and/or gitlab is struggling to deal with the redirect to https?
  2. If so, is there a way around this given our setup mentioned above with the reverse proxy?
  3. If not, am I correct that my only option is to get https working throughout? (Browser <--https--> RP <--http*s*--> GL server)

Thank you for your help.


#2

I resolved this by adding SSL to our internal communications as well. After the fact I did notice a setting in the config that mentioned having a reverse proxy and internal communications over http, so if you too are having this problem and you don’t want to encrypt your internal traffic (which you probably should anyway) then try looking for the setting that mentions a reverse proxy with http external and https internal.


#3

For anyone arriving here looking for the solution to public https -> proxy -> private http -> gitlab
Tested at time of writing in 9.3.6, the settings you need are…
(Note https in external url required)

external_url 'https://git.yourserver.com'
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = {
  "X-Forwarded-Proto" => "https",
  "X-Forwarded-Ssl" => "on"
}