February 05, 2020 04:38AM
I am using nginx upload module for uplaoding files to server. But I wanted nginx to upload to different paths, not to a path mentioned in upload_store. So I am taking help of nginx-lua module to change the upload_store value on each request like below.

location /umtest {
upload_pass /nginx_response;
set $upload_store '';
rewrite_by_lua '
local header = ngx.req.raw_header()
ngx.say("type header",header)
dst_path_dir = ngx.req.get_headers()["Dst-Dir"]
ngx.var.upload_store = dst_path_dir
ngx.say("upload store path" ,ngx.var.upload_store)
upload_set_form_field $
upload_set_form_field $upload_field_name.content_type
upload_set_form_field $upload_field_name.path
upload_cleanup 400 404 499 500-505;

Now when I POST to the '/umtest' it will change the upload_store value, but it will not execute the nginx upload direcives (i.e., upload will not happen). When I comment the rewrite_by_lua directive , the upload happens. My question is cant we use both at a same time to achieve the purpose?_______________________________________________
nginx mailing list
Subject Author Posted

Using nginx upload module and nginx lua together

myxingkong February 05, 2020 04:38AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready