Nexus 3 Docker Registry with NGINX as Reverse Proxy (working)

Well, nothing new. Software Developers not able to provide a working documentation ... just the daily grind

server {
  listen   *:443;
  server_name  host.domain.tld;

  # allow large uploads of files
  client_max_body_size 100G;

  # optimize downloading files larger than 1G
  #proxy_max_temp_file_size 200G;

  ssl on;
  ssl_certificate      /etc/letsencrypt/live/host.domain.tld/fullchain.pem;
  ssl_certificate_key  /etc/letsencrypt/live/host.domain.tld/privkey.pem;

  location / {
   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 /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 $scheme;
   proxy_pass          http://127.0.0.1:5000;
   proxy_read_timeout  90;
  }

 # if your docker hosted repo is named "docker-registry"
 location ~ /v2/repository/docker-registry/(.*) {
  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 $scheme;
  proxy_pass          http://127.0.0.1:5000/v2/$1;
  proxy_read_timeout  90;
 }
}