nginx 1.5+ file upload -- best practices
I'm looking to upload files through my nginx
server. I'm currently running nginx-1.4.6
and am willing up move to the latest stable nginx-1.5*
as necessary.
The community favorite is/was Valery Kholodkov's nginx-upload-module
, found here. Regrettably Valery is no longer maintaining this module, details here. As of nginx-1.3.9
the module works partially or not at all.
I've compiled the nginx-upload-module
into nginx-1.4.6
and am getting a bug (Client cxn closed) that seems to be fixed in the nginx-1.5.3
changeset. However I've applied the patch and had no luck.
Anatoly's slightly dated post, here, offers multiple solutions, includes four solutions
- nginx-upload-module
- nginx-big-upload
- lua-resty-upload
- clientbodyinfileonly
As I dive into the second and fourth solutions (I prefer not to make lua
a dependency, but I might) I figured that it's appropriate to ask this community:
What are the current best practices for file uploading with nginx-1.5+
?
Let me add that I'm uploading files from a python
POST
command and trying to test with curl
. PHP
is not on my tech stack.
Maybe you can use perl if you don't like php or lua.
http://nginx.org/en/docs/http/ngx_http_perl_module.html#methods
$r->has_request_body(handler)
But out of the box nginx isn't the tool to save a received post request and store it.
Maybe uWSGI ( https://uwsgi-docs.readthedocs.io/en/latest/ ) is a better way to go with http-socket https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html and a python app.