﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
752	try_files + subrequest + proxy-handler problem	openid.yandex.ru/emychlo		"When using subrequests with try_files the following behaviour is observed.

{{{
   server {
       listen       8081;
       default_type text/html;

       location /uno {   return 200 ""uno  "";   }
       location /duo {   return 200 ""duo  "";   }
       location /tres {  return 200 ""tres  "";  }
   }


   server {
       listen       8080;

       location / {
           root /tmp;
           try_files /tres =404;
           proxy_pass http://127.0.0.1:8081;
           add_after_body /duo;
       }
   }
}}}


Assuming /tmp/tres exists, a request to

http://127.0.0.1:8080/uno

returns **""uno  tres ""**, not **""uno  duo ""** or  **""tres tres ""**.

I.e., main request assumes that the request URI is unmodified and passes original request URI, ""/uno"".
But in a subrequest the URI is modified and nginx uses modified URI, ""/tres"".

This is believed to be a bug, and one of the following should be done:

- `try_files` should reset the `r->valid_unparsed_uri` flag if it modifies the URI;
- or `try_files` should not modify the URI at all.

See [[http://mailman.nginx.org/pipermail/nginx-ru/2015-April/055769.html|this thread]] (in Russian) for additional details."	defect	accepted	minor		nginx-core	1.7.x		try_files		Darwin myc.rutube.corp 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64	"nginx version: nginx/1.7.12
built by clang 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include -g -DNGX_DEBUG_MALLOC -O0' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/tmp/nginx.pid --error-log-path=/tmp/nginx-error.log --with-http_addition_module --with-debug --http-client-body-temp-path=/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/tmp/nginx/proxy_temp --http-scgi-temp-path=/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/tmp/nginx/uwsgi_temp --http-log-path=/tmp/nginx-access.log"
