GitLab7升级到了8.2后无法push解决方法(2)

location ~ ^/[\w\.-]+/[\w\.-]+/gitlab-lfs/objects {
 client_max_body_size 0;
 # 'Error' 418 is a hack to re-use the @gitlab-workhorse block
 error_page 418 = @gitlab-workhorse;
 return 418;
 }

location ~ ^/[\w\.-]+/[\w\.-]+/(info/refs|git-upload-pack|git-receive-pack)$ {
 client_max_body_size 0;
 # 'Error' 418 is a hack to re-use the @gitlab-workhorse block
 error_page 418 = @gitlab-workhorse;
 return 418;
 }

location ~ ^/[\w\.-]+/[\w\.-]+/repository/archive {
 client_max_body_size 0;
 # 'Error' 418 is a hack to re-use the @gitlab-workhorse block
 error_page 418 = @gitlab-workhorse;
 return 418;
 }

location ~ ^/api/v3/projects/.*/repository/archive {
 client_max_body_size 0;
 # 'Error' 418 is a hack to re-use the @gitlab-workhorse block
 error_page 418 = @gitlab-workhorse;
 return 418;
 }

# Build artifacts should be submitted to this location
 location ~ ^/[\w\.-]+/[\w\.-]+/builds/download {
 client_max_body_size 0;
 # 'Error' 418 is a hack to re-use the @gitlab-workhorse block
 error_page 418 = @gitlab-workhorse;
 return 418;
 }

# Build artifacts should be submitted to this location
 location ~ /ci/api/v1/builds/[0-9]+/artifacts {
 client_max_body_size 0;
 # 'Error' 418 is a hack to re-use the @gitlab-workhorse block
 error_page 418 = @gitlab-workhorse;
 return 418;
 }

location @gitlab-workhorse {

## 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-workhorse 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 ;
 }

## Enable gzip compression as per rails guide:
 ## #gzip-compression
 ## WARNING: If you are using relative urls remove the block below
 ## See config/application.rb under "Relative url support" for the list of
 ## other files that need to be changed for relative url support
 location ~ ^/(assets)/ {
 root /opt/gitlab/embedded/service/gitlab-rails/public;
 gzip_static on; # to serve pre-gzipped version
 expires max;
 add_header Cache-Control public;
 }

error_page 502 /502.html;
}

更多GitLab相关教程见以下内容

Ubuntu 14.04下安装GitLab指南 

如何在Ubuntu Server 14.04下安装Gitlab中文版 

CentOS源码安装GitLab汉化版 

在 Ubuntu 12.04 上安装 GitLab

GitLab 5.3 升级注意事项

在 CentOS 上部署 GitLab (自托管的Git项目仓库)

在RHEL6/CentOS6/ScientificLinux6上安装GitLab 6.0.2

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/15167.html