OOM when using `ngx_echo`'s subrequests
rr- opened this issue · 1 comments
rr- commented
In light of #17 I tried to use ngx_echo
to make it include README.txt
, but I failed miserably.
Using 0.4.1 on nginx 1.10, any call to echo_location_async
or similar from within a page generated by fancyindex rapidly eats all available memory until it crashes my machine.
Accessing the faux location directly (not through fancy index) properly includes the file I want.
Configuration:
server {
server_name xxxxx;
listen 443;
ssl on;
ssl_certificate xxxxx;
ssl_certificate_key xxxxx;
fancyindex on;
fancyindex_exact_size off;
fancyindex_header /HEADER.html;
fancyindex_show_path off;
root /srv/www/xxxxx/;
index index.html index.txt;
access_log /var/log/nginx/access_xxxxx.log main;
location /HEADER.html {
echo '<!DOCTYPE html>';
echo '<html>';
echo '<head>';
echo '<meta name="viewport" content="width=device-width"/>';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>';
echo '<title>Index of $request_uri</title>';
echo '</head>';
echo '<body>';
echo '<h1>Index of $request_uri</h1>';
echo_location_async '/index.txt';
}
}
In the example above, accessing /any-dir/
crashes the server, whereas accessing /HEADER.html
, which isn't handled by fancyindex, renders the page as expected.
FWIW here's directory tree for the example above:
/
srv/
www/
xxxxx/
any-dir/
file1.txt
file2.txt
index.txt
HEADER.html
(not a physical file)
aperezdc commented
This looks quite serious, I'll try and take a look this in the next days. Thanks for reporting.