I have a lot of hard drives in my server and I want to upload files to them. Since it is overhead to upload a file to one drive and then move it to another, I would like to directly upload the file to a temporary folder on the drive it is supposed to be stored.
location /upload/(.*)$ {
upload_store /home/hoster-node/data/$1/tmp/;
I tried something like this with the idea to post the files to /upload/sda2
or something, and then store the temporary file right there.
However I get some failure like this when trying to start nginx:
Restarting nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] mkdir() "/home/hoster-node/data/$1/tmp/" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
If course I could go ahead and create 24 different location directives along with all the other stuff, one for every drive...
But I plan to do this in a big system and I would like to organise drives by their file systems uuids, so this would be really impractical. Only a measure of last resort. Still better than moving the file from the system drive to the storage drive every time...
Any input is appriciated!
0 Answers