Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull image Error response from daemon: error parsing HTTP 404 response body: #11995

Closed
lijujntao120 opened this issue May 21, 2020 · 14 comments
Closed
Assignees

Comments

@lijujntao120
Copy link

公司内多部署了一套harbor.v1.6.2 ,通过另一台服务器的nginx反向代理出去,浏览器可以正常登录.在linux命令行里面也是可以正常登录,但push&pull 一直报错,注:没有使用https
和harbor同台机的Nginx代理又能正常使用,麻烦看一下,谢谢!

和harbor同一台机的nginx配置:

===========================
upstream harbor_port {
server 192.168.1.23:10080;
}

server {
listen 80;
server_name docker-harbor.xx.com;

    location   /
    {
    proxy_pass http://192.168.1.23:10080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
    proxy_connect_timeout 30000;
    proxy_read_timeout 30000;
    proxy_send_timeout 30000;
    proxy_http_version 1.1;
    client_max_body_size 0;
    }

}

另外一台机的nginx配置:
server {
listen 80;
server_name docker-harbor.xxx.com;
location / {

proxy_pass              http://192.168.1.23:10080;
proxy_set_header        Host $host;
proxy_set_header        X-Real-IP $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        X-Forwarded-Proto $scheme;
   client_max_body_size 20m;

}

image

@lijujntao120
Copy link
Author

好像只能本机Nginx能作正常反向代理,其他服务器的nginx不能正常反向代理

@TimeBye
Copy link

TimeBye commented May 24, 2020

尝试修改为这样呢?

另外一台机的nginx配置:

server {
listen 80;
server_name docker-harbor.xxx.com;
location / {

proxy_pass              http://192.168.1.23:10080;
# proxy_set_header        Host $host;
proxy_set_header        X-Real-IP $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        X-Forwarded-Proto $scheme;
   client_max_body_size 20m;

}

@lijujntao120
Copy link
Author

依然不行,公司的网络方式是NAT端口转发方式,将内网IP转发出去~!

@lijujntao120
Copy link
Author

lijujntao120 commented May 24, 2020

location / {

proxy_pass              http://192.168.1.23:10080;
#proxy_set_header        Host $host;
proxy_set_header        X-Real-IP $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        X-Forwarded-Proto $scheme;

client_max_body_size 20m;

}

@lijujntao120
Copy link
Author

image

@bitsf
Copy link
Contributor

bitsf commented May 26, 2020

I think you should also set the hostname in harbor.yml to your external name docker-harbor.xxx.com

@lijujntao120
Copy link
Author

lijujntao120 commented May 27, 2020

在docker-compose.yml 配置里面,我所使用的版本有点旧,是1.6.2,我尝试修改了,依然不生正常使用
networks:
harbor:
external: false

external: http://docker-harbor.xxx.com

external_url: http://docker-harbor.xxx.com

@lijujntao120
Copy link
Author

尝试修改了几次配置,依然无法解决。

Error response from daemon: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "\r\n<title>404 Not Found</title>\r\n<body bgcolor="white">\r\n

404 Not Found

\r\n
nginx/1.14.0\r\n\r\n\r\n"

@bitsf
Copy link
Contributor

bitsf commented May 29, 2020

你可以先在社区的微信群中问问,我记得好像以前有人搭建过nginx的反向代理

@lijujntao120
Copy link
Author

从哪里可以进社区的微信群呢??

@ninjadq
Copy link
Member

ninjadq commented Jun 2, 2020

Is there any error in your company's Nginx? And I find that the external URL you configured is HTTP, But docker pull/push needs a https connection.

@lijujntao120
Copy link
Author

我们push的时候没有使用https的,在使用过程中外面有一层nginx,docker pull/push不成功。
内网访问的是时候通此此nginx代理一下也是不能正常pull/push。
但可以通过harbor所在同一台机的nginx可以正常 pull/push。

@lijujntao120
Copy link
Author

仓库同时开了http https解决了!

@kubehan
Copy link

kubehan commented Jul 28, 2023

解决了吗?我也遇到这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants