linux nginx 503,GitLab网页500/502/503错误–Nginx无法启动问题排查

让小汤装个GitLab,折腾了一周了还没弄好,网站一直是50x错误,看了下情况是nginx服务挂了。这里记录一下排查的步骤。

首先看看gitlab服务的情况:

gitlab-ctl status

。。。。

run: logrotate: (pid 19388) 838s; run: log: (pid 1746) 2102s

finish: mailroom: (pid 30439) 5s; run: log: (pid 1659) 2132s

down: nginx: 1s, normally up, want up; run: log: (pid 1687) 2120s

run: node-exporter: (pid 19578) 829s; run: log: (pid 1979) 2092s

。。。。

看来是nginx服务down了,试试看手动重启nginx:

gitlab-ctl start nginx && gitlab-ctl status

。。。

run: nginx: (pid 972) 7s; run: log: (pid 971) 7s

。。。

开启成功了,但是网页依旧500错误,再看status发现nginx又挂掉了,说明nginx服务内部出现了问题,继续排查。

看看nginx的日志(完整的日志在这里/var/log/gitlab/nginx/current,但是也可以通过tail看实时的情况):

gitlab-ctl tail nginx

。。。

==> /var/log/gitlab/nginx/current <==

2019-11-24_20:19:12.23865 nginx: [emerg] cannot load certificate "/etc/gitlab/ssl/registry.code.cloudraft.cn.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/gitlab/ssl/registry.code.cloudraft.cn.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

。。。

找到问题了,缺了个证书文件,补上就好了。用lsof看看端口监听情况

lsof -i:443

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

nginx 5153 root 10u IPv4 547257 0t0 TCP *:https (LISTEN)

nginx 5161 gitlab-www 10u IPv4 547257 0t0 TCP *:https (LISTEN)

nginx 5162 gitlab-www 10u IPv4 547257 0t0 TCP *:https (LISTEN)

nginx 5163 gitlab-www 10u IPv4 547257 0t0 TCP *:https (LISTEN)

This article is under CC BY-NC-SA 4.0 license.

Please quote the original link:https://www.liujason.com/article/396.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值