Opened 10 years ago
Closed 7 years ago
#585 closed defect (fixed)
SSI include subrequests fails in big POST reply
Reported by: | Hervé Bry | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.7.x |
Keywords: | ssi proxy | Cc: | |
uname -a: | 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 -V: |
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 |
Description
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:
location / {
ssi on;
proxy_pass http://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>
This text will be included in test.html
Change History (4)
comment:2 by , 10 years ago
Keywords: | proxy added |
---|---|
Status: | new → accepted |
Thanks, this is known problem which happens due to an optimization in proxy module: request body cache file is released once a response is got. If later a subrequest tries to use body, it fails. It's unlikely to be fixed in foreseeable future though. Workaround is to use "proxy_pass_request_body off" for subrequests.
comment:4 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
The test file names disappeared in the bug description, but the first one is obviously the config, then test.html and include.html.
And I must add the bug seems similar to the one described in 2011 here : https://gist.github.com/saj/1057940