[Gitlab运维系列]Gitlab 403 forbidden 并发引起IP被封
2018-05-07 19:38
696 查看
问题
我们公司使用git是自建的,有一天开发人员pull push ,报403问题![](https://static.oschina.net/uploads/space/2018/0507/193711_PjLE_3662885.png)
原因
Gitlab使用rack_attack做了并发访问的限制。
解决方案
将Gitlab的IP设置为白名单即可。步骤如下:
打开vim
/etc/gitlab/gitlab.rb文件。
查找
gitlab_rails['rack_attack_git_basic_auth']关键词。
取消注释
修改
ip_whitelist白名单属性,加入Gitlab部署的IP地址。
gitlab_rails['rack_attack_git_basic_auth'] = { 'enabled' => true, 'ip_whitelist' => ["192.168.11.157","Gitlab部署的IP地址"], 'maxretry' => 300, 'findtime' => 5, 'bantime' => 60 }
配置好后,执行
gitlab-ctl reconfigure即可。
git 创建后想要项目地址是域名,那么修改如下配置
vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml ## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: localhost >> 这里改为主机的IP 或域名即可 port: 80 https: false # Uncommment this line below if your ssh host is different from HTTP/HTTPS one # (you'd obviously need to replace ssh.host_example.com with your own host). # Otherwise, ssh host will be set to the `host:` value above
相关文章推荐
- [Gitlab运维系列]Gitlab 403 forbidden 并发引起IP被封
- gitlab之:gitlab 403 forbidden 并发引起ip被封
- gitlab之:gitlab 403 forbidden 并发引起ip被封
- GitLab并发访问过多引起IP被封,提示403
- Python:爬虫使用代理防封IP:HTTP Error 403: Forbidden
- openstack运维实战系列(十一)之neutron替换instance的IP
- gitlab nginx 提示403 forbidden
- 20171107L09-01老男孩Linux运维实战培训-Lamp系列-Apache服务生产实战应用指南04-基于IP的虚拟主机实战配置
- Application Checker 远程输入ip:8889 ,显示403 Forbidden错误。
- Python:爬虫使用代理防封IP:HTTP Error 403: Forbidden
- Application Checker 远程输入ip:8889 ,显示403 Forbidden错误。
- Application Checker 远程输入ip:8889 ,显示403 Forbidden错误。
- Django的CSRF保护引起的403 FORBIDDEN
- Application Checker 远程输入ip:8889 ,显示403 Forbidden错误。
- Application Checker 远程输入ip:8889 ,显示403 Forbidden错误。
- Apache [forbidden 403]错误的解决办法-新建www目录引起的
- 爬虫使用代理防封IP:HTTP Error 403: Forbidden
- 域名访问和ip访问引起的http 403问题
- Nginx 出现403 forbidden错误的设置方法!
- j.u.c系列(08)---之并发工具类:CountDownLatch