1

I've a problem with my nginx server. He is a storage server, and when i want to upload a file (2,5G) i can show any error on my error.log

2016/02/08 03:26:24 [crit] 7843#0: *1154 pwrite() "/var/lib/nginx/body/0000000388" failed (28: No space left on device), client: 78.229.62.244, server: www1.mywebsite.net, request: "POST /upload/ HTTP/1.1", host: "www1.mywebsite.net", referrer: "http://www.mywebsite.net/" 2016/02/08 03:28:37 [crit] 7843#0: *1476 pwrite() "/var/lib/nginx/body/0000000526" failed (28: No space left on device), client: 78.229.62.244, server: www1.mywebsite.net, request: "POST /upload/ HTTP/1.1", host: "www1.mywebsite.net", referrer: "http://www.mywebsite.net/" 2016/02/08 03:29:45 [crit] 7844#0: *1518 pwrite() "/var/lib/nginx/body/0000000550" failed (28: No space left on device), client: 78.229.62.244, server: www1.mywebsite.net, request: "POST /upload/ HTTP/1.1", host: "www1.mywebsite.net", referrer: "http://www.mywebsite.net/" 2016/02/08 03:32:50 [crit] 7846#0: *1572 pwrite() "/var/lib/nginx/body/0000000588" failed (28: No space left on device), client: 78.229.62.244, server: www1.mywebsite.net, request: "POST /upload/ HTTP/1.1", host: "www1.mywebsite.net", referrer: "http://www.mywebsite.net/" 2016/02/08 03:33:23 [crit] 7846#0: *1579 pwrite() "/var/lib/nginx/body/0000000592" failed (28: No space left on device), client: 78.229.62.244, server: www1.mywebsite.net, request: "POST /upload/ HTTP/1.1", host: "www1.mywebsite.net", referrer: "http://www.mywebsite.net/"

And here is my df -h : root@www1:/etc/nginx/sites-enabled# df -h Filesystem Size Used Avail Use% Mounted on /dev/md2 96G 20G 72G 22% / udev 10M 0 10M 0% /dev tmpfs 6.3G 33M 6.3G 1% /run tmpfs 16G 0 16G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 16G 0 16G 0% /sys/fs/cgroup /dev/md3 1.7T 285G 1.4T 18% /home

My site config :

upstream mywebsite { server localhost:8000; }

server { listen 80; server_name mywebsite.log; access_log /var/log/nginx/mywebsite.access.log; error_log /var/log/nginx/mywebsite.error.log; client_max_body_size 10240M;

location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_pass_header Server;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_read_timeout 1200;
}

}

Nginx conf :

root@www1:/etc/nginx# cat nginx.conf user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 1024; use epoll; multi_accept on; } http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}

A little df -i :

Sorry, here is my df -i.

root@sd-87855:/etc/nginx# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda3 61038592 51533 60987059 1% / udev 8250054 355 8249699 1% /dev tmpfs 8260392 457 8259935 1% /run tmpfs 8260392 1 8260391 1% /dev/shm tmpfs 8260392 3 8260389 1% /run/lock tmpfs 8260392 13 8260379 1% /sys/fs/cgroup /dev/sda2 48960 328 48632 1% /boot /dev/sda5 594759680 115967 594643713 1% /home

Thanks for your help, have a good day ;-)

  • What did you do yourself to solve the problem? Besides this: Please provide the output of df -i. – gf_ Feb 10 '16 at 10:15
  • df -i return me that : Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda3 61038592 51533 60987059 1% / udev 8250054 355 8249699 1% /dev tmpfs 8260392 457 8259935 1% /run tmpfs 8260392 1 8260391 1% /dev/shm tmpfs 8260392 3 8260389 1% /run/lock tmpfs 8260392 13 8260379 1% /sys/fs/cgroup /dev/sda2 48960 328 48632 1% /boot /dev/sda5 594759680 115967 594643713 1% /home – Upee Feb 10 '16 at 10:28
  • Could you please put this into your question? It's quite hard to read like this. – gf_ Feb 10 '16 at 10:33
  • done, sorry i'm stupid haha ;) – Upee Feb 10 '16 at 10:37
  • Could you please put it into your question and delete your answer, which actually isn't one? – gf_ Feb 10 '16 at 10:45
1

For me this issue is solved by pointing the temp body store to a file location with enough space.

client_body_temp_path /spool/nginx/client_temp 1 2;

See more about client_body_temp_path in documentation.

0

Try using the nginx upload module. You'll need to build nginx including the module

--add-module=path/to/nginx_upload_module

You can then tell it where to store uploads

upload_store /home/wherever

This was discovered using Google with 5 minutes of research. This is always recommended before asking a question on SO, because it's faster and you may learn something.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.