# Enabling anonymous pull, disables push to Docker repository

**URL:** <https://community.sonatype.com/t/enabling-anonymous-pull-disables-push-to-docker-repository/3748>\
**Category:** Sonatype Nexus Repository\
**Tags:** docker, nexus-repository\
**Created:** [March 25, 2020, 9:55pm UTC](https://community.sonatype.com/t/enabling-anonymous-pull-disables-push-to-docker-repository/3748 "2020-03-25T21:55:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcagatay](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/dcagatay/32/1103_2.png) [@dcagatay](https://community.sonatype.com/u/dcagatay)\
**Post date:** [March 25, 2020, 9:55pm UTC](https://community.sonatype.com/t/enabling-anonymous-pull-disables-push-to-docker-repository/3748/1 "2020-03-25T21:55:14Z")

</div>

Hi all,

(I think) I am having trouble to configure authorization for docker repository image pull and push on Nexus.

I setup a private Docker Repository on Nexus (OSS 3.21.2-03). Enabled anonymous pull on the repository settings, activated docker bearer token realm, enabled the anonymous user, setup a `docker-read` role (docker-_-read, browse) for the anonymous user, and setup a `docker-deploy` role (docker-_-browse, read, edit, add) for an authorized user.

After this configuration, my expected behavior from Nexus Docker Repository was that, I can pull images anonymously(without requiring me to docker login) from the repository, but for pushing I must login.

This configuration enabled me to to anonymously pull images without any problems, but when I try to push (successfully running docker login beforehand) I get the following error:

> unauthorized: access to the requested resource is not authorized

When I disabled the anonymous pull from repository settings, I can push and pull with my authorized user, but not anonymously.

Is there anything I am missing in my configuration?

---

<div class="post-metadata">

**Author:** ![flo](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/flo/32/1558_2.png) [@flo](https://community.sonatype.com/u/flo)\
**Post date:** [November 26, 2020, 9:05am UTC](https://community.sonatype.com/t/enabling-anonymous-pull-disables-push-to-docker-repository/3748/2 "2020-11-26T09:05:33Z")

</div>

Im having the exact same issue with 3.25.1 and anonymous docker pull is just not working ☹

---

<div class="post-metadata">

**Author:** ![v.savostyanov](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@v.savostyanov](https://community.sonatype.com/u/v.savostyanov)\
**Post date:** [March 22, 2021, 6:00am UTC](https://community.sonatype.com/t/enabling-anonymous-pull-disables-push-to-docker-repository/3748/3 "2021-03-22T06:00:49Z")

</div>

I’ve the same issue too, but i find that, when I enable anonymous access to repository, then push and pull requests use http, but not https.

I’ve added X-Forwarded-Proto=https header to ingress and the issue has been resolved.
