4 messages in ru.sysoev.nginxRe: Variables and proxy_pass
FromSent OnAttachments
Jonathan DanceSep 27, 2006 12:48 pm 
Cliff WellsSep 29, 2006 6:02 pm 
Igor SysoevOct 2, 2006 6:08 am 
Igor SysoevOct 2, 2006 6:24 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Variables and proxy_passActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Oct 2, 2006 6:08:28 am
List:ru.sysoev.nginx

On Wed, 27 Sep 2006, Jonathan Dance wrote:

I'm now trying to use variables to allow me to re-use configuration files easily. The basic idea is:

upstream some-mongrel-cluster { ... }

server { ... set $rails_proxy http://some-mongrel-cluster; include macros/rails.conf; }

Then, rails.conf has the standard rails stuff and this line: proxy_pass $rails_proxy;

Not surprisingly, this doesn't work. :) I am wondering what I might do to make it work, but I need to know: - Whether the problem is that the variable is not available from mod_http_proxy (since "set" is a mod_rewrite command?) or just that proxy_pass does not support using variables - If proxy_pass does not support variables, how do I make it do this? Where in the source is a good place to see how variables work?

One of simple places to see how variables work is the "root" and "alias" directives and corresponding them ngx_http_map_uri_to_path() function.

However, it is not so easy to add variables to the proxy_pass directive. I plan to add the variables support ot proxy_pass.