9 messages in ru.sysoev.nginxRe: nginx-0.7.4
FromSent OnAttachments
Igor SysoevJun 30, 2008 5:43 am 
Phillip B OldhamJun 30, 2008 5:59 am 
Igor SysoevJun 30, 2008 6:21 am 
Manlio PerilloJun 30, 2008 6:42 am.patch
mikeJun 30, 2008 8:33 am 
RoxisJun 30, 2008 10:27 am 
Sean AllenJun 30, 2008 10:34 am 
Ed WJun 30, 2008 10:51 am 
Cliff WellsJun 30, 2008 12:45 pm 
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: nginx-0.7.4Actions...
From:Cliff Wells (clif@public.gmane.org)
Date:Jun 30, 2008 12:45:27 pm
List:ru.sysoev.nginx

On Mon, 2008-06-30 at 18:51 +0100, Ed W wrote:

However, I have quite a few rails sites and I would like to use a variable in the proxy_pass definition also..

I would like to use $site to simplify this as follows (so that I can chuck the whole lot in the include section):

You could try something like this (untested):

map $host $backend { hostnames; .admin.mysite.com mongrel_cluster_production.admin.mysite.com; }

upstream mongrel_cluster_production.admin.mysite.com { server 127.0.0.1:8031; server 127.0.0.1:8032; }

server { listen 1.2.3.4; server_name admin.mysite.com *.admin.mysite.com ; set $site "admin.mysite.com"; ... location / { include /etc/nginx/std_rails_root.conf; if (!-f $request_filename) {

proxy_pass http://$backend;

break; } } }

Regards, Cliff