7 messages in ru.sysoev.nginxRe: Conditionals in fastcgi config
FromSent OnAttachments
Andrew DeasonOct 17, 2007 1:00 pm 
RoxisOct 17, 2007 2:18 pm 
Andrew DeasonOct 17, 2007 2:49 pm 
Maxim DouninOct 18, 2007 1:49 am 
Igor ClarkOct 30, 2007 9:04 am 
Maxim DouninOct 30, 2007 9:50 am 
Igor ClarkOct 30, 2007 11:14 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: Conditionals in fastcgi configActions...
From:Igor Clark (igor@public.gmane.org)
Date:Oct 30, 2007 11:14:28 am
List:ru.sysoev.nginx

Hi Maxim,

On 30 Oct 2007, at 16:50, Maxim Dounin wrote:

Hello!

So ideally I'd like to do something like:

fastcgi_param SERVER_NAME $server_name; if ($http_x_forwarded_host) { fastcgi_param SERVER_NAME $http_x_forwarded_host; }

but: firstly "fastcgi_param" is not supported inside "if", and secondly I don't know how or if this "overriding" would work.

What's the best way to do this, please?

You may try something like this:

set $blah $server_name; if ($http_x_forwarded_host) { set $blah $http_x_forwarder_host; }

fastcgi_param SERVER_NAME $blah;

That works perfectly, thank you very much!

All the best, Igor