NGINX后面的Nexus Docker注册表在Docker登录时返回502

NGINX后面的Nexus Docker注册表在Docker登录时返回502,docker,nginx,nexus,Docker,Nginx,Nexus,我的管理员和我都很沮丧,因为我们无法正确设置nexus的docker注册表部分 我们已经在Nexus中设置了“docker托管”存储库。 您可以在下面找到nginx配置: server { listen *:443; server_name server.local; # allow large uploads of files client_max_body_size 50G; # optimize downloading files la

我的管理员和我都很沮丧,因为我们无法正确设置nexus的docker注册表部分

我们已经在Nexus中设置了“docker托管”存储库。 您可以在下面找到nginx配置:

server {
    listen   *:443;
    server_name  server.local;
 
    # allow large uploads of files
    client_max_body_size 50G;
 
    # optimize downloading files larger than 1G
    #proxy_max_temp_file_size 2G;
 
    ssl on;
    ssl_certificate      snakeoil.crt
    ssl_certificate_key  snakeoil.key
 
    location / {
      # Use IPv4 upstream address instead of DNS name to avoid attempts by nginx to use IPv6 DNS lookup
      proxy_pass http://127.0.0.1:8081/;
      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 "https";
    }
   
    location /v1/ {
       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 "https";
       proxy_pass http://172.17.0.1:5000;
    }
}
点击登录时,我们只会得到:

来自守护进程的错误响应:登录尝试https://someToplevelURL.com/v2/ 失败,状态为:502坏网关
另一件事是,为什么即使我们在nexus中切换“Use v1”按钮,它也会迫使我们执行
/v2
?或者甚至转到“网络”选项卡,右键单击其中一个重定向,然后说“清除历史记录”或“缓存”之类的话?使用nginx很常见,当您使用配置时,您迟早会看到“过时”的配置,而不是您刚才所做的配置。nexus GUI中的Togle按钮不强制使用v1,而是“允许客户端使用v1 API与此存储库交互”。换句话说,使用v1的客户端不会被拒绝,但这取决于客户端。你的显然是在用v2。。。这是对端口8081的反向代理,而不是端口5000上的docker注册表