原因:gitlab有rack::attack模块,来防治恶意ip刷机

确定是否是这个原因:

1、查日志
# cd /var/log/gitlab/gitlab-rails/
# grep 'Rack_Attack' production.log|more
Rack_Attack: blacklist 192.168.10.61 GET /

确认这个ip是否是访问者的ip
2、进入redis:
# /opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket
redis /var/opt/gitlab/redis/redis.socket> keys *rack::attack*
1) "cache:gitlab:rack::attack:32647382:allow2ban:count:192.168.10.61"
2) "cache:gitlab:rack::attack:allow2ban:ban:192.168.10.61"

通过两步即可确认,就是这个原因。在redis里清除该条即可:
del cache:gitlab:rack::attack:allow2ban:ban:192.168.10.61

从11版本开始,官方默认不开启这个功能: