Monday, 9 November 2015

Gitlab git push DO NOT work because Gitlab Server Send Error 503 for remote origins ending with a "/"

https://gitlab.com/gitlab-org/gitlab-ce/issues/2727

Got a problem and resolved,
git push DO NOT work because Gitlab Server Send Error 503 for remote origins ending with a "/"

......
Have  issue with Nginx and Omnipackage, but received not 503 but 521 error. 
I resoled issue with steps: 
1. in /etc/gitlab/gitlab.rb
 gitlab_git_http_server['listen_network'] = "tcp"
 gitlab_git_http_server['listen_addr'] = "localhost:8181"
but leave nginx[‘enable’] = true
and run gitlab-ctl reconfigure
2, Change generated gitlab-http.conf
in first part change
upstream gitlab-git-http-server {
  server unix:localhost:8181;
}
to
upstream gitlab-git-http-server {
  server localhost:8181;
}
and after location @gitlab { …} add new section
  location ~ [-\/\w\.]+\.git\/ {
    ## If you use HTTPS make sure you disable gzip compression
    ## to be safe against BREACH attack.
    # gzip off;


    ## https://github.com/gitlabhq/gitlabhq/issues/694
    ## Some requests take more than 30 seconds.
    proxy_read_timeout      300;
    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;
    proxy_set_header    X-Forwarded-Proto   $scheme;

    proxy_pass http://gitlab-git-http-server;
  }
Now gitlab-ctl restart and all return to work

No comments:

Post a comment