How to combine text and variables in fastcgi_param?

Maxim Dounin mdounin at mdounin.ru
Sun Feb 23 13:51:10 UTC 2014


Hello!

On Sun, Feb 23, 2014 at 01:59:39PM +0100, naxa wrote:

> Hello there dear nginx people,
> 
> I am a beginner in nginx and also to mailing lists. :) Once read the
> docs I can't say I am sure I remember all the important parts so please
> excuse me if I am asking something silly. I'm having trouble with using
> the `value` part `fastcgi_param` of ngx_http_fastcgi. I am using nginx
> 1.2.5.
> I am trying to include four spaces between two variables. Here is an
> example in markdown. This is cross-posted at
> http://stackoverflow.com/questions/21968255
> 
> The [fastcgi_param
> docs](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param)
> reads
> 
> > A value can contain text, variables, and their combination.
> 
> Does not link or specify explicitly what the text format is or what the
> combination format is.
> 
> I am trying to add four spaces between two variables in order to
> understand the 'expression format' used in `fastcgi_param`. I get
> errors. Here are relevant parts from `nginx.conf` with line numbers:

Try this:

fastcgi_param SCRIPT_FILENAME  "$document_root    $fastcgi_script_name";

or this:

fastcgi_param SCRIPT_FILENAME  '$document_root    $fastcgi_script_name';

If a parameter includes special characters, the whole parameter 
should be enclosed in single or double quotes.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list