我使用 Nginx 将 /docker-registry proxy_pass 到 http://localhost:5000/,以下是配置:
http {
server {
server_name ...;
listen 443 ssl;
ssl_certificate ...;
ssl_certificate_key ...;
location /docker-registry {
proxy_pass http://localhost:5000/;
}
}
}
events { }
但是执行docker push {domain}/docker-registry/hello-world
时报错了,我应该怎么解决呢?
报错信息如下:
error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"
如果我将 location /docker-registry 改为 location /,然后执行 docker push {domain}/hello-world,是可以成功的。