【发布时间】:2015-11-30 22:31:52
【问题描述】:
我有一个在 Nginx 上运行并运行的公共 Gitlab 安装,我想限制它对 IP 地址白名单的访问。
我尝试在 nginx 中添加一个基本限制,如下所示:
location @gitlab {
allow 127.0.0.1;
allow XXX.XXX.XXX.XXX;
deny all;
...
}
这有点像只有允许的 IP 才能通过 gitlab 的 Web 界面。 但是当涉及到从这些允许的 IP 推送内容时,我收到了这个错误:
Pushing to http://my.server:port/myrepo.git
POST git-receive-pack (451 bytes)
remote: GitLab: API is not accesible
To http://my.server:port/myrepo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://my.server:port/myrepo.git'
很奇怪。我也尝试使用 ngx_http_geo_module,结果相同。 有人可以知道如何完成这项工作吗?
谢谢
【问题讨论】: