Nginx truncates large files when used as a proxy server. How it is fix?

  Kiến thức lập trình

I’m writing a distributed service where there are several servers. Separate servers are responsible for various functions of the service: request processing, frontend, CDN, etc.
And one server works as an entry point, the domain refers to it and it distributes based on the uri to which server to redirect the request.
The problem is that some requests are dropped. If I send a file over 1MB, it may be cut off. Server Tuning

events {
        worker_connections 768;
        multi_accept on;

http {
        client_max_body_size 500M;
        sendfile on;
        tcp_nopush on;
        server_names_hash_bucket_size 2048;
        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;
        access_log /var/log/nginx/access.log;
        gzip off;
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
        server {
                location / {

                listen 443 ssl; # managed by Certbot
                ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
                ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
                include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
                ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
        server {
                return 301 https://$host$request_uri;
                listen      80;