Home > Archives > Gitlab访问出现 403 forbidden解决方案

Gitlab访问出现 403 forbidden解决方案

Publish:

vim /etc/gitlab/gitlab.rb 

gitlab_rails['rack_attack_git_basic_auth'] = {
  'enabled' => true,
  'ip_whitelist' => ["127.0.0.1","101.00.125.00","333.65.12.43"],
  'maxretry' => 10,
  'findtime' => 60,
  'bantime' => 3600
}

gitlab-ctl reconfigure
history

进入Redis,删除被墙的IP

/opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket keys '*' | grep 'rack::attack' | xargs /opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket DEL

参考

+Gitlab访问出现 403 forbidden解决方案

声明: 本文采用 BY-NC-SA 授权。转载请注明转自: Ding Bao Guo