Nginx status=ok with chunked loading

447 views Asked by At

I want to check if a download of a file is finished or cancelled, so i found out that nginx has the option

$request_completion which will give OK or an empty status

I edited the access.log that way that it will log the status parameter.
This method is working well, but I am a little bit confused, what if the user connects multiple times to that file and load it with chunks? Is the status set to "OK" if the last byte was sent, or "knows" nginx if its a multiple request?

For example:

The user connects 4 times to the same file.

First request: 0-499 bytes
Second req. : 500-999 bytes
Third req. : 1000-1499 bytes
Fourth req. : 1500-1623 bytes (End of the file)

Now the last request finished first, will nginx set the Status to "OK", or will it what until the 3 other requests will also finish?
If this is the case, who can I find out if all opened connections are closed?

0

There are 0 answers