Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM when using ngx_echo's subrequests #48

Open
rr- opened this issue Aug 27, 2016 · 1 comment
Open

OOM when using ngx_echo's subrequests #48

rr- opened this issue Aug 27, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@rr-
Copy link

rr- commented Aug 27, 2016

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 aperezdc self-assigned this Aug 28, 2016
@aperezdc aperezdc added this to the v0.4.2 milestone Aug 28, 2016
@aperezdc aperezdc added the bug label Aug 28, 2016
@aperezdc
Copy link
Owner

This looks quite serious, I'll try and take a look this in the next days. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants