• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

READMEH A D11-May-20191.1 KiB7236

configH A D11-May-2019482 2216

let.hH A D11-May-2019679 3319

let.tab.cH A D11-May-201945.9 KiB1,7971,173

let.tab.hH A D11-May-20192 KiB6116

let.yH A D11-May-20194.1 KiB226130

nginx.confH A D11-May-20192.4 KiB11723

ngx_http_let_module.cH A D11-May-201912.9 KiB535361

README

1----------------
2NGINX let module
3----------------
4
5Adds support for arithmetic operations to NGINX config.
6
7(c) 2011 Roman Arutyunyan, arut@qip.ru
8
9
10
11Build:
12======
13
14Add this when configuring NGNIX:
15
16./configure --add-module=$PATH_TO_MODULE
17
18
19
20
21Examples:
22=========
23
24# adds variable $value equal to evaluated expression value
25
26let $value ( $uid + 0x12 ) * $offset - 100 ;
27
28let $remainer $number % 100 ;
29
30let $welcome "Hi, " . $user . ", you have " . $num . " data items";
31# echo $welcome ;
32
33let_rand $randval from to;
34
35
36IMPORTANT NOTE:
37
38let-module uses NGINX config parser as lexer.
39That means you should add spaces around each token.
40
41let $value (1+2);             # ERROR!
42let $value ( 1 + 2 );         # OK
43
44let $value 1 + (2 * $uid);    # ERROR!
45let $value 1 + ( 2 * $uid );  # OK
46
47
48
49Features supported:
50===================
51
52- operations with unsigned integers:
53
54  + - * / %
55
56- string operations:
57
58  . (concatenation)
59
60- hexadecimal numbers
61
62- grouping with parentheses
63
64
65
66Notes:
67======
68
69Use the following command to rebuild parser generator if you need that
70
71bison -d let.y
72