gpt4 book ai didi

docker 注册表和 nginx - 实体太大 - client_max_body_size 无效

转载 作者:行者123 更新时间:2023-12-02 18:53:34 24 4
gpt4 key购买 nike

我已经部署了 docker registry用于图像存储 S3作为存储。

我的一些图片在 GBs 中.所以我设置了 nginx 属性 client_max_body_size5GB .但它仍然给我这个错误。

error parsing HTTP 413 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body bgcolor=\"white\">\r\n<center>

413请求实体太大

注册表

upstream registry_upstream{
server 127.0.0.1:5000;
}

server {
server_name registry.domain.com;
# disable any limits to avoid HTTP 413 for large image uploads
client_max_body_size 0;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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_cache_bypass $http_upgrade;
proxy_pass http://registry_upstream;

}

# managed by Certbot

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/registry.domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/registry.domain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}
server {
if ($host = registry.domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot


server_name registry.domain.com;
listen 80;
client_max_body_size 0;
return 404; # managed by Certbot


}

最佳答案

我已将 client_max_body_size 属性移动到 nginx.conf 中的 http 指令。

http {
client_max_body_size 0;

# configuration of the server
server {
.....
}
}

关于docker 注册表和 nginx - 实体太大 - client_max_body_size 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50613532/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com