使用 CKAN 生产源安装,我尝试通过 API 或 Web 界面上传文件。性能不错,我成功上传了大约 2.5 GB 的文件。现在我需要上传一个大约 4 GB 的文件,但我从
nginx得到了一个
502 Bad Gateway
。
我想我可以排除 nginx 配置作为根源,因为我临时代理到我构建的一个简单的 Web 应用程序来测试文件上传。虽然我可以在那里上传大文件,但我仍然不是 100% 确定。
很明显,我在
ckan.ini
中调整了存储设置
ckan.max_resource_size = 100000
nginx.log
节目:2023/02/28 09:58:51 [error] 27692#27692: *1684 upstream prematurely closed connection while reading response header from upstream, client: 111.111.111.111, server: my-domain-name.de, request: "POST /dataset/test-data/resource/new HTTP/1.1", upstream: "http://127.0.0.1:8080/dataset/test-data/resource/new", host: "my-domain-name.de", referrer: "https://my-domain-name.de/dataset/test-data/resource/new"
uwsgi.sterr.log
节目Tue Feb 28 09:58:50 2023 - *** HARAKIRI ON WORKER 1 (pid: 25434, try: 1) ***
Tue Feb 28 09:58:50 2023 - HARAKIRI !!! worker 1 status !!!
Tue Feb 28 09:58:50 2023 - HARAKIRI [core 0] 127.0.0.1 - POST /dataset/test-data/resource/new since 1677578279
Tue Feb 28 09:58:50 2023 - HARAKIRI !!! end of worker 1 status !!!
DAMN ! worker 1 (pid: 25434) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 28408)
这导致我增加
harakiri
中的ckan-uwsgi.ini
值。有趣的是,这导致 uwsgi.sterr.log
不再显示任何错误,尽管它似乎持续存在并且 nginx.log
根本没有改变。
我也玩过
post_buffering
(然后在nginx中禁用它)也没有解决问题。
有什么想法我可以做些什么吗?提前致谢
我当前的 nginx 配置如下所示:
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=500m;
proxy_temp_path /tmp/nginx_proxy 1 2;
server {
client_max_body_size 10000M;
client_header_timeout 10080;
client_body_timeout 10080;
server_name my-domain-name.de;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_cache cache;
proxy_cache_bypass $cookie_auth_tkt;
proxy_no_cache $cookie_auth_tkt;
proxy_cache_valid 30m;
proxy_cache_key $host$scheme$proxy_host$request_uri;
proxy_connect_timeout 10080s;
proxy_send_timeout 10080;
proxy_read_timeout 10080;
uwsgi_read_timeout 20m;
proxy_request_buffering off;
proxy_buffering off;
# In emergency comment out line to force caching
# proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/my-domain-name.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my-domain-name.de/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 = my-domain-name.de) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name my-domain-name.de;
return 404; # managed by Certbot
}