I have nginx server serving a lot of big files. I can see plenty of connections on the server. As it iw know, file to the accesslog is written after the request is completed.

Is there any way to log request before it is served? The problem is that it takes hours to download large files and I would like to know which files were hit.


No this is not natively possible and that would not make much sense too since most logging information requires the request to complete (status code, bytes sent, durations, etc).

But you can still workaround this with the use of a third party scripting module (perl, lua , groovy etc) that would set you free to do whatever you want while the request is being processed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.