ubuntu - 尝试克隆项目时,带有外部 nginx 的自托管 GitLab 出现 502 错误
问题描述
VPS,清除 Ubuntu 18.04 LTS,2 核,4 GB RAM,25 GB 磁盘;
- 安装nginx和Passenger;
- 在子域中安装 GitLab;
- 禁用 GitLab 内置的 nginx,切换到外部 nginx。
我根据 GitLab 文档做了所有三点。
在 /var/opt/gitlab 上为 git 用户添加授予权限并安装 ruby-dev && nodejs。
之后,GitLab 出现在子域中,我定义了管理员密码,一般来说,网页版看起来可以工作。
但我无法从 GitLab 克隆项目,它收到 502 错误:
$ git clone https://git.myserver.com/root/tock.git Cloning into
'tock'... remote: GitLab is not responding fatal: unable to access
'https://git.myserver.com/root/tock.git/': The requested URL returned
error: 502
当我尝试克隆时,以下条目出现在 var/log/gitlab/nginx/gitlab_access.log 的内置 nginx 日志中:
81.30.208.16 - - [03/May/2021:13:51:42 +0300] "GET /root/tock.git/info/refs?service=git-upload-pack HTTP/1.1" 502 24 "-" "git/2.29.2.windows.2"
当我在浏览器中打开 git.myserver.com 页面时,以下条目会出现在 var/log/gitlab/nginx/gitlab_access.log 的内置 nginx 日志中:
81.30.208.16 - - [03/May/2021:13:56:02 +0300] "GET /users/sign_in HTTP/1.1" 200 15487 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36"
但是 var/log/nginx/access.log 和 var/log/nginx /error.log 的“正常”(预安装,外部)nginx 的日志是空的。
也许内置的 nginx 没有完全禁用?
解决方案
推荐阅读
- pytorch - Pytorch BCELoss 不接受列表
- anychart - AnyChart中的词云可以不使用小写吗?
- python - 通过拖动角来调整 QPaint drawRect 的大小以选择 ImageCrop 区域
- android - 离子从相机中排除谷歌照片.PictureSourceType.PHOTOLIBRARY
- c++ - lld-link 错误:在 Windows10 上尝试与 libcmt.lib 链接时没有输入文件
- swift - 我可以在 Swift UI 中更改图像大小吗
- postgresql - 有没有更简单的方法来编写生成多列的 generate_series 代码?
- c# - 如何通过 C# 为 TPM 虚拟智能卡注册证书
- php - 我应该使用哪种获取模式来读取单个列值
- linux - 更改挂载目录会丢失磁盘数据?