- Upload module
- uuid4 module
$ apt-get build-dep nginx
$ apt-get source nginx
$ cd nginx/debian/modules
$ git clone https://github.com/vkholodkov/nginx-upload-module
$ cd nginx-upload-module; git checkout 2.2; cd ../
$ git clone https://github.com/cybozu/nginx-uuid4-module
$ cd ../../
$ vi debian/rules
Add the new modules:
--add-module=../nginx-uuid4-module \
--add-module=../nginx-upload-module
Build new .deb:
$ dpkg-buildpackage
$ sudo dpkg -i ../nginx-common_1.10.0-0ubuntu0.16.04.2_all.deb ../nginx-extras_1.10.0-0ubuntu0.16.04.2_amd64.deb
Add an upload endpoint in nginx configuration in /etc/nginx/sites-available/default
:
location /upload {
uuid4 $crash_id;
upload_store /tmp 1;
return 200 $crash_id;
}
Now try uploading a file and ensure that a UUID is returned:
curl -F "key=val" http://localhost/upload/