nginx 1.4.x file upload multipart ecoded

Yichun Zhang (agentzh) agentzh at
Fri Jul 26 18:38:42 UTC 2013


On Fri, Jul 26, 2013 at 5:06 AM, David J wrote:
> I was looking at resty upload module. I was curious how to store the file on
> disk relative to the document root?
> For some reason it didn't work unless I specified the absolute path.

You can just obtain the document root in Lua via
ngx.var.document_root, i.e., accessing Nginx's built-in variable

So it's trivial to construct a proper absolute path without assuming
what the document root is in Lua.


More information about the nginx mailing list