September 26, 2014 09:43AM

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
Subject Author Posted

Underscore between variables

jamel September 26, 2014 09:43AM

Re: Underscore between variables

Francis Daly September 26, 2014 10:12AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 314
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready