Welcome! Log In Create A New Profile

Advanced

rewrite_module patch: 'if (-z)' checks for zero-length files

dap
October 15, 2009 09:00AM
Hi!

I've a heavy loaded reverse proxy for large video files on nginx/http_proxy_module. Sometimes I cache a zero-length file due to a problem of the upstream server and it's a headache for my client. I found that, the "if" conditions of the rewrite module doesn't support checks based on file size, so I wrote some code for that, you can found as a diff for 0.7.62 here: http://pastebin.com/m793679da -It's a lightweight modification, I think it could go into mainline.


[...]
location / {
[...]
# if (!-f $request_filename) { # damned empty cached files,
if (-z $request_filename) { # bye, bye! :)
proxy_pass http://indavideo;
}
[...]
}
[...]


Thanks for your great work,
--
Roland Pallai
Sysadmin at Indavideo.hu
Subject Author Posted

rewrite_module patch: 'if (-z)' checks for zero-length files

dap October 15, 2009 09:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 222
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready