nginx和docker registry都需要设置证书
nginx配置文件如下
upstream my_docker_registry {
ip_hash;
server 127.0.0.1:32773;
server 127.0.0.1:32774;
server 127.0.0.1:32775;
#server 127.0.0.1:32770;
}
server {
listen 5000 ssl;
server_name registry.vrviu.com;
ssl_certificate /export/registry_ssl_certs/registry.v.com.crt;
ssl_certificate_key /export/registry_ssl_certs/registry.v.com.key;
client_max_body_size 0;
# disable any limits to avoid HTTP 413 for large image uploads
# required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486)
chunked_transfer_encoding on;
location / {
proxy_pass https://my_docker_registry;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
参考:https://docs.docker.com/registry/recipes/nginx/#starting-and-stopping
http://blog.csdn.net/renhuailin/article/details/50461651
http://www.cnblogs.com/highend/p/docker_registry_push_error_blob-upload-unknown.html