﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
585	SSI include subrequests fails in big POST reply	Hervé Bry		"In the following situation:
 - nginx is used as a proxy
 - SSI processing is enabled on nginx
 - a POST request is big enough that the body needs to be stored on disk
 - the reply of the POST request contains SSI include tags

The subrequests generated by the SSI includes fails with the following error :
[crit] 18249#0: *8455632166 pread() ""/var/lib/nginx/body/0047817306"" failed (9: Bad file descriptor) while sending request to upstream

In the end, the 502 error page is included instead of the requested URIs.

Reproducible using the following files:

---- relevant nginx config 

location / {
    ssi on;
    proxy_pass http://backend;
}

---- test.html on backend

<html>
  <body>
    <form action=""test.html"" enctype=""multipart/form-data"" method=""post"">
      <input type=""file"" name=""f""/>
      <input type=""submit""/>
    </form>
    <p><!--# include virtual=""include.html"" --></p>
  </body>
</html>

---- include.html on backend

This text will be included in test.html"	defect	closed	minor		nginx-core	1.7.x	fixed	ssi proxy		Linux dev-www.liancourt.gnet 2.6.38.7-server-1mnb2 #1 SMP Sun May 22 21:22:07 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.7.2
built by gcc 4.4.3 (GCC) 
TLS SNI support enabled
configure arguments: --with-http_stub_status_module --with-http_ssl_module --with-http_secure_link_module --with-http_sub_module --with-http_realip_module --with-ipv6 --prefix=/var/lib/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --add-module=nginx-upload-progress-module-master"
