Conditionals in fastcgi config

Igor Clark igor at pokelondon.com
Tue Oct 30 21:14:51 MSK 2007


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;
>
>
> Maxim Dounin

That works perfectly, thank you very much!

All the best,
Igor

--
Igor Clark // POKE // 10 Redchurch Street // E2 7DD // +44 (0)20 7749  
5355 // www.pokelondon.com

--
Get on Board with WWF for a stronger Climate Change Bill
http://getonboard.wwf.org.uk/



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20071030/289a2db8/attachment.html>


More information about the nginx mailing list