Docker Registry only needs a basic HTTP Proxy configuration with CloudFlare Origin SSL.
Note: Authentication is still handled by Docker Registry.
upstream docker-registry { server 172.17.0.3:5000; } map $upstream_http_docker_distribution_api_version $docker_distribution_api_version { '' 'registry/2.0'; } ## Normal HTTP host server { listen 0.0.0.0:80; listen [::]:80; listen 0.0.0.0:443 ssl http2; listen [::]:443 ssl http2; server_name registry.felinewith.me; ## Replace this with something like gitlab.example.com server_tokens off; ## Don't show the nginx version number, a security best practice ssl_certificate /***/cf_cert.pem; ssl_certificate_key /***/cf_key.key; ## Individual nginx logs for this GitLab vhost access_log /var/log/nginx/registry_access.log; error_log /var/log/nginx/registry_error.log; client_max_body_size 0; chunked_transfer_encoding on; set $ssl off; if ($scheme = https) { set $ssl on; } location /v2/ { add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $http_cf_connecting_ip; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Ssl $ssl; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade_gitlab; proxy_set_header REMOTE_ADDR $http_cf_connecting_ip; proxy_read_timeout 900; proxy_pass http://docker-registry; } }