Skip to content

Cant push to harbor registry #22459

@kusumaningrat

Description

@kusumaningrat

I just deploy the harbor into nomad. But I have an issue where I cant push the image from my local into my private registry using admin/<my_pass> credential while I can authenticated using same credential to the Portal UI.

When I try to push it to my private repo <IP/Domain>/myimage/test, I always get 405 Not Allowed

256f393e029f: Layer already exists 
unknown: <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.19.3</center>
</body>
</html>

Is there any wrong for my proxy config ?

Here my portal and proxy config
portal

worker_processes auto;
pid /tmp/nginx.pid;

events {
    worker_connections  1024;
}

http {

    client_body_temp_path /tmp/client_body_temp;
    proxy_temp_path /tmp/proxy_temp;
    fastcgi_temp_path /tmp/fastcgi_temp;
    uwsgi_temp_path /tmp/uwsgi_temp;
    scgi_temp_path /tmp/scgi_temp;

    server {
        listen 8081;
        server_name  localhost;

        root   /usr/share/nginx/html;
        index  index.html index.htm;
        include /etc/nginx/mime.types;

        gzip on;
        gzip_min_length 1000;
        gzip_proxied expired no-cache no-store private auth;
        gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        location /devcenter-api-2.0 {
            try_files $uri $uri/ /swagger-ui-index.html;
        }

        location / {
            try_files $uri $uri/ /index.html;
        }

        location = /index.html {
            add_header Cache-Control "no-store, no-cache, must-revalidate";
        }
    }
}

proxy

worker_processes auto;
pid /tmp/nginx.pid;

events {
    worker_connections 3096;
    use epoll;
    multi_accept on;
}

http {
    client_body_temp_path /tmp/client_body_temp;
    proxy_temp_path /tmp/proxy_temp;
    fastcgi_temp_path /tmp/fastcgi_temp;
    uwsgi_temp_path /tmp/uwsgi_temp;
    scgi_temp_path /tmp/scgi_temp;
    tcp_nodelay on;

    proxy_http_version 1.1;

    log_format timed_combined '$remote_addr - '
        '"$request" $status $body_bytes_sent '
        '"$http_referer" "$http_user_agent" '
        '$request_time $upstream_response_time $pipe';

    access_log /dev/stdout timed_combined;

    map $http_x_forwarded_proto $x_forwarded_proto {
        default $http_x_forwarded_proto;
        ""      $scheme;
    }

    upstream portal {
        server harbor-portal.service.consul:8081;
    }

    upstream core {
        server harbor-core.service.consul:8080;
    }

    upstream registry {
        server harbor-registry.service.consul:5000;
    }

    server {
        listen 8085;
        server_tokens off;
        client_max_body_size 0;

        add_header X-Frame-Options DENY;
        add_header Content-Security-Policy "frame-ancestors 'none'";

        # Web UI
        location / {
            proxy_pass http://portal/;
            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 $x_forwarded_proto;
            proxy_buffering off;
            proxy_request_buffering off;
        }

        # Core token service
        location /service/ {
            proxy_pass http://core/service/;
            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 $x_forwarded_proto;
            proxy_buffering off;
            proxy_request_buffering off;
        }

        # Core API
        location /api/ {
            proxy_pass http://core/api/;
            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 $x_forwarded_proto;
            proxy_buffering off;
            proxy_request_buffering off;
        }

        # Docker Registry API
        location /v2/ {
            proxy_pass http://registry/v2/;
            proxy_set_header Host $http_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 $x_forwarded_proto;
            proxy_buffering off;
            proxy_request_buffering off;
            proxy_send_timeout 900;
            proxy_read_timeout 900;
        }

        # Disable notifications endpoint
        location /service/notifications {
            return 404;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions