it would be easier to define server_name with regexp and use match groups
server {
server_name ~ ^(?\w+)\.(?\w+)\.(?\w+)$;
set $graphite_host "${a}_${b}_${c}";
}
09.03.15 18:36, Matthias Rieber пишет:
Hi,
I'd like to set a variable to the value of $host where the dots are
replaced by unde
Hi,
I'd like to set a variable to the value of $host where the dots are
replaced by underscore. My first idea:
map $host $graphite_host {
"~(?P[^.]*)\.(?P[^.]*)\.(?P[^.]*)" $a_$b_$c;
}
But I can't use more than one variable in the result. $a or $b would
work, but not $a_$b or $a$b. I alway