Variables disallowed in first proxy_redirect parameter?

Maxim Khitrov mkhitrov at
Mon Nov 23 21:36:58 MSK 2009

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 == "":

proxy_redirect http://$host/ https://$host/;
proxy_redirect 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;
proxy_redirect http://$myhost/ https://$myhost/;
proxy_redirect https://$myhost/;

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

- Max

More information about the nginx mailing list