Nginx only serving first 72kbs of my JS files

2019-09-15 09:11发布

问题:

Nginx appears to only be loading the first 72kbs of my javascript files. I've searched all around my nginx config files and cannot see this setting anywhere. I've added things like

location / {
    ...
    proxy_max_temp_file_size 1m;
    ...
}

and

location / {
    ...
    sendfile on;
    sendfile_max_chunk 1m;

    ...
}

But still I'm unable to overwrite this weird setting that is only allowing first part of the file to load.

The connection uses nginx proxy_pass to foward port 80 to kibanas port '5601'. I feel like there could be a setting that limits file transfer over proxy? Just not sure where to find it.

proxypass connection looks like:

server {
    listen 80;

    server_name logs.mydomain.com;

    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location / {
        proxy_pass http://localhost:5601;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

And my default nginx settings is posted here:

http://www.heypasteit.com/clip/OEKIR

回答1:

Would appear when disk space is low NGINX defaults to minimal safe settings.

When I checked the VMs health I noticed that the disk drive was full. Elasticsearch was logging a couple of GBs worth of text in to error logs each day. I still Have not fully identified why elastic search is flooding the error logs.

But I think excessive disk space usage has contributed to this error. Nginx could be detecting this and switching over to minimal safe configuration which would only allow 72kbs of data to be served per file.

Once I cleared out the excessive logs, Nginx began serving the full JS files again without needing to restart nginx or kibana.