﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
664	$upstream_http_var not able to be used in proxy_set_header	Joel Gilliland		"Maybe I'm doing this wrong, but see below.

== Doesn't work: ==

upstream myapp {
	server myapplication:8080;
}

upstream php {
	server 127.0.0.1:9000;
}

server {
	...

	location ~ /protected/ {
		internal;
		rewrite /protected(.*) /myapp$1 break; ''#this is to rewrite the original path back to the original value to pass to myapp. This prevent CSRF errors. Removing this has no effect on outcome.''
		'''proxy_set_header MYVAR $upstream_http_myvar;'''
		proxy_pass http://myapp;
	}
	
	location ~ /myapp {
		fastcgi_pass php;
		fastcgi_param  SCRIPT_FILENAME  $document_root/my-x-accel-script.php;
		include        fastcgi_params;
    }
	
	...
}



== Works: ==

upstream myapp {
	server myapplication:8080;
}

upstream php {
	server 127.0.0.1:9000;
}

server {
	...

	location ~ /protected/ {
		internal;
		'''if ($upstream_http_myvar != """") { '''
			'''set $myvar $upstream_http_myvar;'''
		'''}'''
		rewrite /protected(.*) /myapp$1 break;
		'''proxy_set_header MYVAR $myvar;'''
		proxy_pass http://myapp;
	}
	
	location ~ /myapp {
		fastcgi_pass php;
		fastcgi_param  SCRIPT_FILENAME  $document_root/my-x-accel-script.php;
		include        fastcgi_params;
    }
	
	...
}"	defect	closed	minor		nginx-core	1.6.x	invalid			Linux 2.6.32-279.el6.x86_64	"nginx version: nginx/1.6.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)

also tried yum installed nginx.x86_64 1.6.2-1.el6.ngx as well as 1.0.15-10.el6"
