﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1067	behaviour of location + proxy_pass with a variable does not match behaviour with hardcoded value	allan-simon@…		"Here's a minimal case to reproduce 


{{{
server {
  listen 80;
  location /myservice/ {
    proxy_pass http://127.0.0.1:8080/;
  }
}
}}}

with a    nc -l 8080 acting as proxified proxy

the following command 

curl http://localhost/myservice/foo/far

show on netcat side, as expected 


{{{
GET /foo/bar HTTP/1.0
Host: 127.0.0.1:8080
Connection: close
User-Agent: curl/7.43.0
Accept: */*


}}}
 
now if i use a variable to store my proxified service's domain like this


{{{
server {
  listen 80;
  set $MY_SERVICE ""127.0.0.1:8080"";
  location /myservice/ {
    proxy_pass http://$MY_SERVICE/;
  }
}
}}}
 

now regardless of the URI, the proxified value will always be


{{{
GET / HTTP/1.0
Host: 127.0.0.1:8080
Connection: close
User-Agent: curl/7.43.0
Accept: */*


}}}

notice now the GET has become / , though it should be GET /foo/bar"	defect	closed	minor		nginx-core	1.9.x	invalid	location variables		"Linux all-MacBookPro 4.2.0-42-generic #49-Ubuntu SMP Tue Jun 28 21:26:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
"	"nginx version: nginx/1.9.3 (Ubuntu)
built with OpenSSL 1.0.2d 9 Jul 2015
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module
"
