# docker login failed 

**URL:** https://community.sonatype.com/t/docker-login-failed/13501
**Category:** Best Practices
**Tags:** nexus-repository, docker
**Created:** [September 20, 2024, 1:53pm UTC](https://community.sonatype.com/t/docker-login-failed/13501 "2024-09-20T13:53:12Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![rahuls50](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@rahuls50](https://community.sonatype.com/u/rahuls50)
#### Post date: [September 20, 2024, 1:53pm UTC](https://community.sonatype.com/t/docker-login-failed/13501/1 "2024-09-20T13:53:12Z")

</div>

Hello Team,

I have installed nexus-3.69.0-02 on standalone server. I have also created docker hosted Repositories **URL:- [https://testnexusrepo.xxx.com/repository/dockertest/](https://testnexusrepo.xxx.com/repository/dockertest/)**

and I have also installed nginx on the same server.

================================================  
please check details of nginx file

server {  
listen \*:443 ssl http2;  
server\_name [testnexusrepo.xxx.com](http://testnexusrepo.xxx.com);

```
    # allow large uploads of files - refer to nginx documentation
    client_max_body_size 1G;

    # optimize downloading files larger than 1G - refer to nginx doc before adjusting
    #proxy_max_temp_file_size 2G;

    ssl_certificate /home/k8testadmin/testnexus.xxx.com.crt;
    ssl_certificate_key /home/k8testadmin/testnexus.xxx.com.key;

    location / {
        proxy_pass http://[ip address of server]: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 /v2 {
        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://testnexusrepo.xxx.com:8081/repository/dockertest/$request_uri;

```

# } 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://testnexusrepo.xxx.com:8081/repository/dockertest/$request\_uri](http://testnexusrepo.xxx.com:8081/repository/dockertest/$request_uri); } }

1:- My nginx service is running  
2:- nexus service is also running

## But when I try to login using below command its failing

## root@master1:~# docker login [https://testnexusrepo.XXX.com](https://testnexusrepo.XXX.com) Username: admin Password: time=“2024-09-20T13:49:22+05:30” level=info msg=“Error logging in to endpoint, trying next endpoint” error=“login attempt to [https://testnexusrepo.XXX.com/v2/](https://testnexusrepo.XXX.com/v2/) failed with status: 502 Bad Gateway” login attempt to [https://testnexusrepo.XXX.com/v2/](https://testnexusrepo.XXX.com/v2/) failed with status: 502 Bad Gateway root@master1:~#

Issue is because of this developer is not able to pull push the images.

Can anyone please help me what i am missing..

---

_[View the full topic](https://community.sonatype.com/t/docker-login-failed/13501)._
