Underscore between variables

jamel nginx-forum at nginx.us
Fri Sep 26 13:43:59 UTC 2014


Hello,
 
I'm trying to rewrite URL with parameters x, y, z to filename by such
template: file_{x}_{y}_{z}.txt
 
location /path {
    rewrite ^ /path/file_$arg_x_$arg_y_$arg_z.txt break;
    root /var/www;
}
 
But it is not working. Because nginx tries to use variables x_, y_.
How can I use underscore symbol to separate variables?
 
In bash there is curly brackets style for such cases: ${x}_${y}_${z}.
May be nginx has something special for this too.
 
-- 
Sergey Polovko

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,253560,253560#msg-253560



More information about the nginx mailing list