M
M
Mikhail Emelyanov2021-05-03 14:08:00
Nginx
Mikhail Emelyanov, 2021-05-03 14:08:00

How to configure GitLab installed on your own server so that it does not give a 502 error when trying to clone a project?

I put GitLab on my site, in a subdomain, behind my own nginx, the problem is that I can’t clone the project from GitLab, it gives an error 502.

More details:
VPS, clean Ubuntu 18.04 LTS, 2 cores, 4 GB RAM, disk 25 GB;
1. I install nginx, then Passenger (without Passenger it will not be possible to switch GitLab from built-in to external nginx);
2. I put GitLab in a subdomain;
3. disable nginx built into GitLab, switch to external nginx.

I do all three points in accordance with the documentation on GitLab.

Immediately after that, GitLab does not work, I find errors in the logs, I add:
I give rights to the git user on /var/opt/gitlab;
install ruby-dev && nodejs.

After that, GitLab appears in the subdomain, I determine the administrator password, in general, the web version looks working.

But - I can't clone the project from GitLab, gives error 502:
$ git clone https://git.tradercad.com/root/tock.git
Cloning into 'tock'...
remote: GitLab is not responding
fatal: unable to access ' https://git.tradercad.com/root/tock.git/ ': The requested URL returned error: 502

Strangely, when requesting git clone in the nginx built-in logs at var/log/gitlab/nginx/gitlab_access .log entry appears:
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"

and when you open the page git.tradercad.com var/log/gitlab/nginx/gitlab_access.log in the browser, an entry appears:
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"

while in "normal" logs nginx at var/log/nginx/access.log and var/log/nginx/error.log nothing, empty.

Maybe nginx, built into GitLab, is not completely disabled?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-05-03
@sepulkary

No need to disable built-in Nginx, just proxy requests to it.
Do n't forget to set external_url in gitlab.rb .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question