#导入MD文档图片#harbor无法登陆failed with status: 502

## 现象
```shell
[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
```
## 排查
```shell
# 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
```
## 验证
```shell
[root@ln0-181 nginx]# curl -I http://harbor.spos.lab/harbor/sign-in
HTTP/1.1 200 OK
```

上一篇:C# 时间格式化 DateTime 函数


下一篇:vSphere Client 6.7迁移虚拟机报错源主机上的wMotion接口未配置,或者配置错误