This nginx configuration allows to restrict access via different methods to separate users.
This is very useful for private docker registries, where you want every member of your team to be able to fetch Docker images, but only some users (admins and CI users) to push new images to the registry.
Example:
- User
write
can use GET, POST, PUT, DELETE and everything else. - User
read
can only use GET and HEAD. - Anonymous users are denied access entirely.