Variables disallowed in first proxy_redirect parameter?

Hello all,

Is it not possible to use variables in the first parameter to
proxy_redirect directive? I ran some experiments and it seems that
given the following two configurations, only the second one works,
even though $host == “site.domain.com”:

proxy_redirect http://$host/ https://$host/;
proxy_redirect http://site.domain.com/ https://$host/;

I’ve looked at the Location headers being returned in both cases, so I
know what $host is set to in the second (working) example.
Furthermore, I also tried this config:

set $myhost site.domain.com;
proxy_redirect http://$myhost/ https://$myhost/;
proxy_redirect http://site.domain.com/ https://$myhost/;

Same result - only the second version works. Is this a bug or by design?

  • Max

Hello!

On Mon, Nov 23, 2009 at 01:36:58PM -0500, Maxim K. wrote:

Hello all,

Is it not possible to use variables in the first parameter to
proxy_redirect directive? I ran some experiments and it seems that
given the following two configurations, only the second one works,
even though $host == “site.domain.com”:

Variables allowed only in replacement part.

Maxim D.