Hello,
Is there a preferred way to send a file from a specific path? That is, the lua script figures out the path, maybe even from a database lookup, and sends it to the user. I'd rather utilize nginx's strength of sending static content efficiently. These files are not something I want to load into lua memory if it can be avoided.
My current method sets up a public location with an alias, and lua then uses ngx.exec to do an "internal redirect" to that file.
For example:
ngx.exec("/super-secret-folder-please-dont-look" .. path)
And in nginx configs:
location /super-secret-folder-please-dont-look {
alias /home/protected/resources/here;
}
---
Is there a better way that does not involve an otherwise accessible (when known) secret location?
Thank you,