#21 Handle uploads with nginx
Opened 3 years ago by samwwwblack. Modified 2 years ago

Currently vowel handles any uploads from the user, and that could lead to memory exhaustion.

The nginx upload module could be used to handle the buffering and writing to disk.

The filepath is passed through to vowel, so that the upload endpoint can move the file into the correct location.
This would also allow scanning, conversion or compression to be performed before being declared "clean" and moved into the document store.

jQuery upload example: https://github.com/blueimp/jQuery-File-Upload/wiki/Uploading-to-nginx-using-the-nginx-upload-module


An upload endpoint in nginx will need login protection, as the upload is completed before the request is passed onto vowel.

Use of ngx_http_auth_request_module may be needed, for example:

location /upload {
    # ...
    auth_request /auth/check;
}
location = /auth/check {
    proxy_pass http://vowel/auth/check;
    proxy_pass_request_body off;
    proxy_set_header Content-Length "";
    proxy_set_header X-Original-URI $request_uri;
}

Metadata Update from @samwwwblack:
- Issue tagged with: enhancement

2 years ago

Login to comment on this ticket.

Metadata