proxy_pass not passing to dynamic $host

Francis Daly francis at daoine.org
Fri Nov 1 05:47:10 UTC 2013


On Thu, Oct 31, 2013 at 09:39:54PM -0400, nehay2j wrote:

Hi there,

> I am making a GET call through browser like- 
> https://example.com/ec2..com

So "$1" = "/ec2..com" and the proxy_pass argument is http:///ec2..com/test

> Error Logs-
> 
> 2013/11/01 01:33:49 [error] 13086#0: *1 no host in upstream
> "/ec2-xx-xxx-xxx-xxx..amazonaws.com:8080/test",
> client: 10.10.4.167, server: clarity-test.cloud.tibco.com, request: "GET
> /ec2-xx-xx-xxx-xx..amazonaws.com HTT
> P/1.1", host: "example.com"

In "http:///ec2..com/test", the host is between the second and third /,
which is blank, hence "no host in upstream".

Change something so that the proxy_pass argument is http://ec2..com/test.

Either use "proxy_pass http:/$1/test", or keep http://$1/test and remove
the / from $1 by putting it outside the ().

Then try again.

And if the error message indicates "resolver", see
http://nginx.org/r/resolver.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list