码迷,mamicode.com
首页 > 其他好文 > 详细

今日排错---harbor无法登陆failed with status: 502 Bad Gateway

时间:2021-05-24 07:34:00      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:pst   not   ups   err   host   failed   cat   问题   请求   

现象

[root@ln0-181 src]# docker login harbor.spos.lab
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: login attempt to http://harbor.spos.lab/v2/ failed with status: 502 Bad Gateway
Username (admin): admin
Password: 
Error response from daemon: login attempt to http://harbor.spos.lab/v2/ failed with status: 502 Bad Gateway

排查

# 1. 直接请求harbor接口可以访问, 通过nginx代理不通
[root@ln0-181 conf.d]# curl -I http://harbor.spos.lab:180/harbor/sign-in
HTTP/1.1 200 OK
[root@ln0-181 conf.d]# curl -I http://harbor.spos.lab:80/harbor/sign-in
HTTP/1.1 502 Bad Gateway
# 2. nginx配置及启动没有问题
# 3. 查看nginx error日志
2021/05/13 09:54:17 [crit] 32484#0: *3 connect() to 127.0.0.1:180 failed (13: Permission denied) while connecting to upstream, client: 172.19.0.181, server: harbor.spos.lab, request: "HEAD /harbor/sign-in HTTP/1.1", upstream: "http://127.0.0.1:180/harbor/sign-in", host: "harbor.spos.lab"
# 4. 查看防火墙及selinux
[root@ln0-181 nginx]# getenforce 
Enforcing
[root@ln0-181 nginx]# setenforce 0
[root@ln0-181 nginx]# getenforce 
Permissive

验证

[root@ln0-181 nginx]# curl -I http://harbor.spos.lab/harbor/sign-in
HTTP/1.1 200 OK

今日排错---harbor无法登陆failed with status: 502 Bad Gateway

标签:pst   not   ups   err   host   failed   cat   问题   请求   

原文地址:https://www.cnblogs.com/i-xiaojun/p/14763350.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!