docker - Docker push nexus private repo 失败,413 Request Entity Too Large
问题描述
我已经部署了一个 Nexus OSS 的本地实例,它是在 Nginx 反向代理后面到达的。
在任何尝试将 docker 映像推送到在 Nexus 注册表上创建的存储库时,我都会
413 Request Entity Too Large
在推送过程中碰到一个。
nginx.conf 文件如下所示:
http {
client_max_body_size 0;
upstream nexus_docker {
server nexus:1800;
}
server {
server_name nexus.services.loc;
location / {
proxy_pass http://nexus_docker/;
proxy_set_header Host $http_post;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
nginx 是使用 docker 部署的,我已经使用docker login
. 我尝试了多个其他标志,例如 chunkin 等。但似乎没有任何效果。
解决方案
client_max_body_size
这是因为您的服务器块在未设置时具有大约 1MB 大小的默认值。
要解决此问题,您需要将以下行添加到您的服务器块:
# Unlimit large file uploads to avoid "413 Request Entity Too Large" error
client_max_body_size 0;
http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
推荐阅读
- python - 如何读取 CSV 文件并将一行中的每个单元格添加到列表中?
- ios - 使用来自服务器的字符串公钥的 RSA 加密
- android - 从 Firebase 加载个人资料图片 URL 时滑行抛出“java.lang.SecurityException”
- mongodb - 如何在 Mac 中的 intelliJ Idea 中配置 mongodb,因为当您要浏览路径时没有显示任何 usr/local/mongodb 文件
- sql - 多个点找到聚会点
- html - 如何在嵌套 SVG 中设置参考点?
- vb.net - 如何从 Txt 文件创建和填充数据表
- javascript - 在 D3 中使用不同数据集更新数据的问题
- java - 尝试在没有“硬编码”的情况下创建多个用户
- java - Vert.x Http 请求未将参数分配为配置