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

Connection closes with a large file list on Nginx 1.5.3 and later #55

Closed
mihailbulychev opened this issue Jun 9, 2016 · 3 comments
Closed
Labels

Comments

@mihailbulychev
Copy link

We use mod_zip module. After setting up a new server (under FreeBSD) we've installed fresh nginx (1.10.1) and found that there's a limit for a number of rules. Also there's a limit on a total rules size. If the limit is exceeded, connection closes and nginx reports an error:

2016/06/08 17:41:33 [error] 82841#101370: *1646064 upstream prematurely closed connection while reading upstream, client: 10.118.254.242, server: , request: "GET /test.php HTTP/1.1", upstream: "http://176.xx.xx.xx:8092/test.php", host: "xxxxx.com".

Two examples:

  1. 78 zipping rules, ~11000 byte
  2. 99 rules (with a shorter path), ~8000 bytes

If we add one more rule in any of these cases, connection closes with an error.

Could you give us a hint of a possible reason of this behaviour? What nginx settings may affect and fix it? Or it's an nginx's bug?

Everything worked fine with nginx 1.4.4.

mod_zip version is 1.1.6
Nginx config are the same for both versions.

...
server {
listen 176.xx.xx.xx:80;
...
location ~ /upltest/(.*) {
root /usr/home/test;
index index.html;
}
...
}
...

Rule example:

  • 6523091 /upltest/A/ABCvJOqZdlmF/ABCo_o_1ak7ouul5gcob0i1jk1qvtko8rm DSC_1234.JPG

nginx's log

@mihailbulychev
Copy link
Author

New server and the old problem. Now on the Ubuntu operating system.
Empirically determined that mod_zip module doesn't function properly since Nginx 1.5.3. I've tried variety of settings in nginx and php, but without success. Please, take a look on nginx 1.5.3 changelist, probably it could give any ideas of possible reasons of the problem.

@evanmiller
Copy link
Owner

For reference:

Changes with nginx 1.5.3                                         30 Jul 2013

    *) Change in internal API: now u->length defaults to -1 if working with
       backends in unbuffered mode.

    *) Change: now after receiving an incomplete response from a backend
       server nginx tries to send an available part of the response to a
       client, and then closes client connection.

    *) Bugfix: a segmentation fault might occur in a worker process if the
       ngx_http_spdy_module was used with the "client_body_in_file_only"
       directive.

    *) Bugfix: the "so_keepalive" parameter of the "listen" directive might
       be handled incorrectly on DragonFlyBSD.
       Thanks to Sepherosa Ziehau.

    *) Bugfix: in the ngx_http_xslt_filter_module.

    *) Bugfix: in the ngx_http_sub_filter_module.

@evanmiller evanmiller added the bug label Oct 7, 2017
@evanmiller evanmiller changed the title Connection closes on updated nginx when number of files is exceeded Connection closes with a large file list on Nginx 1.5.3 and later Oct 7, 2017
@mihailbulychev
Copy link
Author

The error was in our code and we forgot to close this issue. Someone for some reason sent header Content-Length. And this worked fine until nginx 1.5.3.

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