title: Redirecting to docker registry with nginx
body: <p>All I would like to do is control the top endpoint (MY_ENDPOINT where users will login and pull images. The registry and containers are being hosted (DOCKER_SAAS), so all I need is a seemingly simple redirect. Concretely, where you would normally do:</p>
  <pre><code>docker login -u ... -p ... DOCKER_SAAS
  docker pull DOCKER_SAAS/.../...
  </code></pre>
  <p>I would like to allow:</p>
  <pre><code>docker login -u ... -p ... MY_ENDPOINT
  docker pull MY_ENDPOINT/.../...
  </code></pre>
  <p>And even more optimally I would prefer:</p>
  <pre><code>docker login MY_ENDPOINT
  docker pull MY_ENDPOINT/.../...
  </code></pre>
  <p>where the difference in the last item is that the endpoint contains a hashed version of the username and password, which is set into an <code>Authorization</code> header (using <code>Basic</code>) - so the user doesn't even need to worry about username and password, just their URL. I've tried a <code>proxy_pass</code> as we are already doing for basic packaging (using HTTPS), but that fails with a 404 (in part because we do not handle /v2 - do I need to redirect that through, also?). This led me to <a href="https://docs.docker.com/registry/recipes/nginx/" rel="noreferrer">https://docs.docker.com/registry/recipes/nginx/</a>, but this seems to only be pertinent if you are hosting the registry. Is what I am trying to do even possible?</p>