proxy_pass $variable

Arkadiusz Patyk areq at areq.eu.org
Mon Jul 21 23:37:06 MSD 2008


On Mon, 21 Jul 2008 14:32:03 +0400, you wrote:

>On Sun, Jul 20, 2008 at 11:09:17PM +0200, Arkadiusz Patyk wrote:
>
>> This works:
>>      set $back backend;
>>      if ($evil) { set $back evil;}
>>      if ($back = backend) {  proxy_pass  http://backend; }
>>      if ($back = evil)    {  proxy_pass  http://evil; }
>> 
>> this not:
>>       set $back http://backend;
>>       if ($evil) { set $back http://evil;}
>>       proxy_pass $back;
>> 
>> 2008/07/20 23:02:55 [error] 13800#0: *7342 upstream sent no valid
>> HTTP/1.0 header while reading response header from upstream, client: ,
>> server: XXXX, request: "GET / HTTP/1.1", upstream:
>> "http://10.9.14.20:8600", host: "XXXX:81"
>> 
>> Is possible to use variable in proxy_pass  ?
>
>The string with variables in proxy_pass should be a full URL:
>
>-      proxy_pass $back;
>+      proxy_pass $back$request_uri;

thanks, now it works.

Cheers,
-- 
Arkadiusz Patyk [areq<>pld-linux:org] [http://rescuecd.pld-linux.org/]
[IRC:areq GG:1383 jid:arek<>patyk:net]





More information about the nginx mailing list