I have a fresh install of Gitlab CE on a (fresh) Ubuntu server on azure. I followed these steps:
When running gitlab-ctl reconfigure
, there are no errors and when checking the status, all seems fine:
gitlab-ctl status
run: alertmanager: (pid 25974) 1118s; run: log: (pid 16605) 8207s
run: crond: (pid 25982) 1117s; run: log: (pid 19799) 6955s
run: gitaly: (pid 25990) 1117s; run: log: (pid 16029) 8325s
run: gitlab-exporter: (pid 26003) 1117s; run: log: (pid 16495) 8225s
run: gitlab-kas: (pid 26159) 1104s; run: log: (pid 16241) 8306s
run: gitlab-workhorse: (pid 26090) 1107s; run: log: (pid 16402) 8242s
run: logrotate: (pid 26100) 1106s; run: log: (pid 15981) 8335s
run: nginx: (pid 26106) 1106s; run: log: (pid 16426) 8237s
run: node-exporter: (pid 26120) 1106s; run: log: (pid 16476) 8231s
run: postgres-exporter: (pid 26125) 1105s; run: log: (pid 16671) 8199s
run: postgresql: (pid 26139) 1105s; run: log: (pid 16101) 8314s
run: puma: (pid 26148) 1104s; run: log: (pid 16325) 8254s
run: redis: (pid 26153) 1104s; run: log: (pid 16007) 8329s
run: redis-exporter: (pid 26168) 1103s; run: log: (pid 16522) 8217s
run: registry: (pid 26175) 1104s; run: log: (pid 19818) 6950s
run: sidekiq: (pid 26184) 1104s; run: log: (pid 16362) 8249s
It seems gitlab is running fine: I can access the login page when I run wget localhost:8080
on the VM (see below).
However, when I try to access gitlab by url (or ip address), the requests times out.
# wget localhost
--2023-08-03 10:23:19-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://cf-git.westeurope.cloudapp.azure.com:443/ [following]
--2023-08-03 10:23:19-- https://cf-git.westeurope.cloudapp.azure.com/
Resolving cf-git.westeurope.cloudapp.azure.com (cf-git.westeurope.cloudapp.azure.com)... 4.210.152.225
Connecting to cf-git.westeurope.cloudapp.azure.com (cf-git.westeurope.cloudapp.azure.com)|4.210.152.225|:443... ^C
The resolving localhost and ip address works fine: it connects to https://cf-git.westeurope.cloudapp.azure.com/ . However, there’s no answer when accessing that url.
My best guess is that nginx is not properly configured. I have no custom/own nginx installed, so I think it’s the nginx config of gitlab. Not sure if it’s the right one, but checking the nginx configuration of gitlab (removing all the commented lines), nginx only seems to listen to port 80:
/opt/gitlab/embedded/conf# cat nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
What am I missing? Or rather, how can I debug/solve the problem?
Thanks a lot!
$ wget localhost:8080
--2023-08-03 10:20:13-- http://localhost:8080/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost:8080/users/sign_in [following]
--2023-08-03 10:20:13-- http://localhost:8080/users/sign_in
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8175 (8.0K) [text/html]
Saving to: ‘index.html’
index.html 100%[==========================================================>] 7.98K --.-KB/s in 0s
2023-08-03 10:20:13 (1.06 GB/s) - ‘index.html’ saved [8175/8175]
root@vm-cod-p-git:/opt/gitlab/embedded/conf# cat index.html
<!DOCTYPE html>
<html class="html-devise-layout" lang="en">
<head prefix="og: http://ogp.me/ns#">
<meta charset="utf-8">
...
<form class="gl-p-5 gl-show-field-errors js-arkose-labs-form" id="new_user" aria-live="assertive" data-testid="sign-in-form" action="/users/sign_in" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="_cvkxI6c7hlFQtobdca39Ml1tXxgnnBMbfvGQf_Mpm8IbpAn49mqqSqOQIpgtxrre_87-g9_2MR9bF1WF4BzsA" autocomplete="off" /><div class="form-group">
<label for="user_login">Username or email</label>
<input class="form-control gl-form-input js-username-field" autocomplete="username" autofocus="autofocus" autocapitalize="off" autocorrect="off" required="required" title="This field is required." data-qa-selector="login_field" data-testid="username-field" type="text" name="user[login]" id="user_login" />
</div>
<div class="form-group">
<label for="user_password">Password</label>
<input class="form-control gl-form-input js-password" data-id="user_password" data-qa-selector="password_field" data-testid="password-field" data-name="user[password]" type="password" name="user[password]" id="user_password" />
<div class="form-text gl-text-right">
<a href="/users/password/new">Forgot your password?</a>
</div>
</div>
<div class="form-group">
</div>
<div class="gl-form-checkbox custom-control custom-checkbox">
<input name="user[remember_me]" type="hidden" value="0" autocomplete="off" /><input autocomplete="off" class="custom-control-input" type="checkbox" value="1" name="user[remember_me]" id="user_remember_me" />
<label class="custom-control-label" for="user_remember_me"><span>Remember me</span></label>
</div>
<button class="gl-button btn btn-block btn-md btn-confirm js-sign-in-button " data-qa-selector="sign_in_button" data-testid="sign-in-button" type="submit"><span class="gl-button-text">
Sign in
</span>
</button></form>