-
Does nginx-unit supports sendfile like nginx does? There is no reference about this topic in the current manual, while there are some source files which reference a "sendfile" mechanism. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
AFAICT Unit will use an OS's sendfile(2) where it's available. This seems to be; Linux, FreeBSD, macOS, Solaris and HP-UX and AIX (not sure how much we really support those last two...). I'm assuming this only works for static file sharing, can't say I've noticed any sendfile(2) system calls when strace(1)ing applications under Unit. |
Beta Was this translation helpful? Give feedback.
-
What I would like to know if unit does recognize the |
Beta Was this translation helpful? Give feedback.
A static share won't work on its own.
The typical use case is for the application logic to handle access control and if all is good then send the location of the resource in its response.
Instead of sending a 302 response with a Location header. The application can send a 200 response with the location in the
X-Accel-Redirect
header. This instructs the proxy to just send the resource directly.Unit could potentially support this with chaining.