1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451
|
<!---
Don't edit this file manually! Instead you should generate it by using:
wiki2markdown.pl doc/HttpSetMiscModule.wiki
-->
Name
====
**ngx_set_misc** - Various set_xxx directives added to nginx's rewrite module (md5/sha1, sql/json quoting, and many more)
*This module is not distributed with the Nginx source.* See [the installation instructions](#installation).
Table of Contents
=================
* [Name](#name)
* [Version](#version)
* [Synopsis](#synopsis)
* [Description](#description)
* [Directives](#directives)
* [set_if_empty](#set_if_empty)
* [set_quote_sql_str](#set_quote_sql_str)
* [set_quote_pgsql_str](#set_quote_pgsql_str)
* [set_quote_json_str](#set_quote_json_str)
* [set_unescape_uri](#set_unescape_uri)
* [set_escape_uri](#set_escape_uri)
* [set_hashed_upstream](#set_hashed_upstream)
* [set_encode_base32](#set_encode_base32)
* [set_base32_padding](#set_base32_padding)
* [set_misc_base32_padding](#set_misc_base32_padding)
* [set_base32_alphabet](#set_base32_alphabet)
* [set_decode_base32](#set_decode_base32)
* [set_encode_base64](#set_encode_base64)
* [set_decode_base64](#set_decode_base64)
* [set_encode_base64url](#set_encode_base64url)
* [set_decode_base64url](#set_decode_base64url)
* [set_encode_hex](#set_encode_hex)
* [set_decode_hex](#set_decode_hex)
* [set_sha1](#set_sha1)
* [set_md5](#set_md5)
* [set_hmac_sha1](#set_hmac_sha1)
* [set_hmac_sha256](#set_hmac_sha256)
* [set_random](#set_random)
* [set_secure_random_alphanum](#set_secure_random_alphanum)
* [set_secure_random_lcalpha](#set_secure_random_lcalpha)
* [set_rotate](#set_rotate)
* [set_local_today](#set_local_today)
* [set_formatted_gmt_time](#set_formatted_gmt_time)
* [set_formatted_local_time](#set_formatted_local_time)
* [Caveats](#caveats)
* [Installation](#installation)
* [Building as a dynamic module](#building-as-a-dynamic-module)
* [Compatibility](#compatibility)
* [Report Bugs](#report-bugs)
* [Source Repository](#source-repository)
* [Changes](#changes)
* [Test Suite](#test-suite)
* [Getting involved](#getting-involved)
* [Author](#author)
* [Copyright & License](#copyright--license)
* [See Also](#see-also)
Version
=======
This document describes ngx_set_misc [v0.32](https://github.com/openresty/set-misc-nginx-module/tags) released on 19 April 2018.
Synopsis
========
```nginx
location /foo {
set $a $arg_a;
set_if_empty $a 56;
# GET /foo?a=32 will yield $a == 32
# while GET /foo and GET /foo?a= will
# yeild $a == 56 here.
}
location /bar {
set $foo "hello\n\n'\"\\";
set_quote_sql_str $foo $foo; # for mysql
# OR in-place editing:
# set_quote_sql_str $foo;
# now $foo is: 'hello\n\n\'\"\\'
}
location /bar {
set $foo "hello\n\n'\"\\";
set_quote_pgsql_str $foo; # for PostgreSQL
# now $foo is: E'hello\n\n\'\"\\'
}
location /json {
set $foo "hello\n\n'\"\\";
set_quote_json_str $foo $foo;
# OR in-place editing:
# set_quote_json_str $foo;
# now $foo is: "hello\n\n'\"\\"
}
location /baz {
set $foo "hello%20world";
set_unescape_uri $foo $foo;
# OR in-place editing:
# set_unescape_uri $foo;
# now $foo is: hello world
}
upstream_list universe moon sun earth;
upstream moon { ... }
upstream sun { ... }
upstream earth { ... }
location /foo {
set_hashed_upstream $backend universe $arg_id;
drizzle_pass $backend; # used with ngx_drizzle
}
location /base32 {
set $a 'abcde';
set_encode_base32 $a;
set_decode_base32 $b $a;
# now $a == 'c5h66p35' and
# $b == 'abcde'
}
location /base64 {
set $a 'abcde';
set_encode_base64 $a;
set_decode_base64 $b $a;
# now $a == 'YWJjZGU=' and
# $b == 'abcde'
}
location /hex {
set $a 'abcde';
set_encode_hex $a;
set_decode_hex $b $a;
# now $a == '6162636465' and
# $b == 'abcde'
}
# GET /sha1 yields the output
# aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
location /sha1 {
set_sha1 $a hello;
echo $a;
}
# ditto
location /sha1 {
set $a hello;
set_sha1 $a;
echo $a;
}
# GET /today yields the date of today in local time using format 'yyyy-mm-dd'
location /today {
set_local_today $today;
echo $today;
}
# GET /signature yields the hmac-sha-1 signature
# given a secret and a string to sign
# this example yields the base64 encoded singature which is
# "HkADYytcoQQzqbjQX33k/ZBB/DQ="
location /signature {
set $secret_key 'secret-key';
set $string_to_sign "some-string-to-sign";
set_hmac_sha1 $signature $secret_key $string_to_sign;
set_encode_base64 $signature $signature;
echo $signature;
}
location = /rand {
set $from 3;
set $to 15;
set_random $rand $from $to;
# or write directly
# set_random $rand 3 15;
echo $rand; # will print a random integer in the range [3, 15]
}
```
Description
===========
This module extends the standard HttpRewriteModule's directive set to provide more functionalities like URI escaping and unescaping, JSON quoting, Hexadecimal/MD5/SHA1/Base32/Base64 digest encoding and decoding, random number generator, and more!
Every directive provided by this module can be mixed freely with other [ngx_http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)'s directives, like [if](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) and [set](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set). (Thanks to the [Nginx Devel Kit](https://github.com/simpl/ngx_devel_kit)!)
[Back to TOC](#table-of-contents)
Directives
==========
[Back to TOC](#table-of-contents)
set_if_empty
------------
**syntax:** *set_if_empty $dst <src>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Assign the value of the argument `<src>` if and only if variable `$dst` is empty (i.e., not found or has an empty string value).
In the following example,
```nginx
set $a 32;
set_if_empty $a 56;
```
the variable `$dst` will take the value 32 at last. But in the sample
```nginx
set $a '';
set $value "hello, world"
set_if_empty $a $value;
```
`$a` will take the value `"hello, world"` at last.
[Back to TOC](#table-of-contents)
set_quote_sql_str
-----------------
**syntax:** *set_quote_sql_str $dst <src>*
**syntax:** *set_quote_sql_str $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will quote the value of the second argument `<src>` by MySQL's string value quoting rule and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set $value "hello\n\r'\"\\";
set_quote_sql_str $quoted $value;
echo $quoted;
}
```
Then request `GET /test` will yield the following output
```sql
'hello\n\r\'\"\\'
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "hello\n\r'\"\\";
set_quote_sql_str $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive is usually used to prevent SQL injection.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_quote_pgsql_str
-------------------
**syntax:** *set_quote_pgsql_str $dst <src>*
**syntax:** *set_quote_pgsql_str $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
Very much like [set_quote_sql_str](#set_quote_sql_str), but with PostgreSQL quoting rules for SQL string literals.
[Back to TOC](#table-of-contents)
set_quote_json_str
------------------
**syntax:** *set_quote_json_str $dst <src>*
**syntax:** *set_quote_json_str $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will quote the value of the second argument `<src>` by JSON string value quoting rule and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set $value "hello\n\r'\"\\";
set_quote_json_str $quoted $value;
echo $quoted;
}
```
Then request `GET /test` will yield the following output
```javascript
"hello\n\r'\"\\"
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "hello\n\r'\"\\";
set_quote_json_str $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_unescape_uri
----------------
**syntax:** *set_unescape_uri $dst <src>*
**syntax:** *set_unescape_uri $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will unescape the value of the second argument `<src>` as a URI component and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set_unescape_uri $key $arg_key;
echo $key;
}
```
Then request `GET /test?key=hello+world%21` will yield the following output
```
hello world!
```
The nginx standard [$arg_PARAMETER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_) variable holds the raw (escaped) value of the URI parameter. So we need the `set_unescape_uri` directive to unescape it first.
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $key $arg_key;
set_unescape_uri $key;
echo $key;
}
```
then request `GET /test?key=hello+world%21` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_escape_uri
--------------
**syntax:** *set_escape_uri $dst <src>*
**syntax:** *set_escape_uri $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
Very much like the [set_unescape_uri](#set_unescape_uri) directive, but does the conversion the other way around, i.e., URL component escaping.
[Back to TOC](#table-of-contents)
set_hashed_upstream
-------------------
**syntax:** *set_hashed_upstream $dst <upstream_list_name> <src>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Hashes the string argument `<src>` into one of the upstream name included in the upstream list named `<upstream_list_name>`. The hash function being used is simple modulo.
Here's an example,
```nginx
upstream moon { ... }
upstream sun { ... }
upstream earth { ... }
upstream_list universe moon sun earth;
location /test {
set_unescape_uri $key $arg_key;
set $list_name universe;
set_hashed_upstream $backend $list_name $key;
echo $backend;
}
```
Then `GET /test?key=blah` will output either "moon", "sun", or "earth", depending on the actual value of the `key` query argument.
This directive is usually used to compute an nginx variable to be passed to [memc-nginx-module](http://github.com/openresty/memc-nginx-module)'s [memc_pass](http://github.com/openresty/memc-nginx-module#memc_pass) directive, [redis2-nginx-module](http://github.com/openresty/redis2-nginx-module)'s [[HttpRedis2Module#redis2_pass]] directive, and [ngx_http_proxy_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html)'s [proxy_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) directive, among others.
[Back to TOC](#table-of-contents)
set_encode_base32
-----------------
**syntax:** *set_encode_base32 $dst <src>*
**syntax:** *set_encode_base32 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will encode the value of the second argument `<src>` to its base32(hex) digest and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set $raw "abcde";
set_encode_base32 $digest $raw;
echo $digest;
}
```
Then request `GET /test` will yield the following output
```
c5h66p35
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
RFC forces the `[A-Z2-7]` RFC-3548 compliant encoding, but we are using the "base32hex" encoding (`[0-9a-v]`) by default. The [set_base32_alphabet](#set_base32_alphabet) directive (first introduced in `v0.28`) allows you to change the alphabet used for encoding/decoding so RFC-3548 compliant encoding is still possible by custom configurations.
By default, the `=` character is used to pad the left-over bytes due to alignment. But the padding behavior can be completely disabled by setting [set_base32_padding](#set_base32_padding) `off`.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "abcde";
set_encode_base32 $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_base32_padding
------------------
**syntax:** *set_base32_padding on|off*
**default:** *on*
**context:** *http, server, server if, location, location if*
**phase:** *no*
This directive can control whether to pad left-over bytes with the "=" character when encoding a base32 digest by the
[set_encode_base32](#set_encode_base32) directive.
This directive was first introduced in `v0.28`. If you use earlier versions of this module, then you should use [set_misc_base32_padding](#set_misc_base32_padding) instead.
[Back to TOC](#table-of-contents)
set_misc_base32_padding
-----------------------
**syntax:** *set_misc_base32_padding on|off*
**default:** *on*
**context:** *http, server, server if, location, location if*
**phase:** *no*
This directive has been deprecated since `v0.28`. Use [set_base32_padding](#set_base32_padding) instead if you are using `v0.28+`.
[Back to TOC](#table-of-contents)
set_base32_alphabet
-------------------
**syntax:** *set_base32_alphabet <alphabet>*
**default:** *"0123456789abcdefghijklmnopqrstuv"*
**context:** *http, server, server if, location, location if*
**phase:** *no*
This directive controls the alphabet used for encoding/decoding a base32 digest. It accepts a string containing the desired alphabet like "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" for standard alphabet.
Extended (base32hex) alphabet is used by default.
This directive was first introduced in `v0.28`.
[Back to TOC](#table-of-contents)
set_decode_base32
-----------------
**syntax:** *set_decode_base32 $dst <src>*
**syntax:** *set_decode_base32 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
Similar to the [set_encode_base32](#set_encode_base32) directive, but does exactly the opposite operation, .i.e, decoding a base32(hex) digest into its original form.
[Back to TOC](#table-of-contents)
set_encode_base64
-----------------
**syntax:** *set_encode_base64 $dst <src>*
**syntax:** *set_encode_base64 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will encode the value of the second argument `<src>` to its base64 digest and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set $raw "abcde";
set_encode_base64 $digest $raw;
echo $digest;
}
```
Then request `GET /test` will yield the following output
```
YWJjZGU=
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "abcde";
set_encode_base64 $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_encode_base64url
-----------------
**syntax:** *set_encode_base64url $dst <src>*
**syntax:** *set_encode_base64url $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will encode the value of the second argument `<src>` to its base64 url safe digest and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set $raw "abcde";
set_encode_base64url $digest $raw;
echo $digest;
}
```
Then request `GET /test` will yield the following output
```
YWJjZGU=
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "abcde";
set_encode_base64url $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_decode_base64
-----------------
**syntax:** *set_decode_base64 $dst <src>*
**syntax:** *set_decode_base64 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
Similar to the [set_encode_base64](#set_encode_base64) directive, but does exactly the opposite operation, .i.e, decoding a base64 digest into its original form.
[Back to TOC](#table-of-contents)
set_decode_base64url
-----------------
**syntax:** *set_decode_base64url $dst <src>*
**syntax:** *set_decode_base64url $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
Similar to the [set_encode_base64url](#set_encode_base64url) directive, but does exactly the the opposite operation, .i.e, decoding a base64 url safe digest into its original form.
[Back to TOC](#table-of-contents)
set_encode_hex
--------------
**syntax:** *set_encode_hex $dst <src>*
**syntax:** *set_encode_hex $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will encode the value of the second argument `<src>` to its hexadecimal digest and assign the result into the first argument, variable `$dst`. For example,
```nginx
location /test {
set $raw "章亦春";
set_encode_hex $digest $raw;
echo $digest;
}
```
Then request `GET /test` will yield the following output
```
e7aba0e4baa6e698a5
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "章亦春";
set_encode_hex $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_decode_hex
--------------
**syntax:** *set_decode_hex $dst <src>*
**syntax:** *set_decode_hex $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
Similar to the [set_encode_hex](#set_encode_hex) directive, but does exactly the opposite operation, .i.e, decoding a hexadecimal digest into its original form.
[Back to TOC](#table-of-contents)
set_sha1
--------
**syntax:** *set_sha1 $dst <src>*
**syntax:** *set_sha1 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will encode the value of the second argument `<src>` to its [SHA-1](http://en.wikipedia.org/wiki/SHA-1) digest and assign the result into the first argument, variable `$dst`. The hexadecimal form of the `SHA-1` digest will be generated automatically, use [set_decode_hex](#set_decode_hex) to decode the result if you want the binary form of the `SHA-1` digest.
For example,
```nginx
location /test {
set $raw "hello";
set_sha1 $digest $raw;
echo $digest;
}
```
Then request `GET /test` will yield the following output
```
aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "hello";
set_sha1 $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_md5
-------
**syntax:** *set_md5 $dst <src>*
**syntax:** *set_md5 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
**category:** *ndk_set_var_value*
When taking two arguments, this directive will encode the value of the second argument `<src>` to its [MD5](http://en.wikipedia.org/wiki/MD5) digest and assign the result into the first argument, variable `$dst`. The hexadecimal form of the `MD5` digest will be generated automatically, use [set_decode_hex](#set_decode_hex) to decode the result if you want the binary form of the `MD5` digest.
For example,
```nginx
location /test {
set $raw "hello";
set_md5 $digest $raw;
echo $digest;
}
```
Then request `GET /test` will yield the following output
5d41402abc4b2a76b9719d911017c592
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
When taking a single argument, this directive will do in-place modification of the argument variable. For example,
```nginx
location /test {
set $value "hello";
set_md5 $value;
echo $value;
}
```
then request `GET /test` will give exactly the same output as the previous example.
This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive.
[Back to TOC](#table-of-contents)
set_hmac_sha1
-------------
**syntax:** *set_hmac_sha1 $dst <secret_key> <src>*
**syntax:** *set_hmac_sha1 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Computes the [HMAC-SHA1](http://en.wikipedia.org/wiki/HMAC) digest of the argument `<src>` and assigns the result into the argument variable `$dst` with the secret key `<secret_key>`.
The raw binary form of the `HMAC-SHA1` digest will be generated, use [set_encode_base64](#set_encode_base64), for example, to encode the result to a textual representation if desired.
For example,
```nginx
location /test {
set $secret 'thisisverysecretstuff';
set $string_to_sign 'some string we want to sign';
set_hmac_sha1 $signature $secret $string_to_sign;
set_encode_base64 $signature $signature;
echo $signature;
}
```
Then request `GET /test` will yield the following output
```
R/pvxzHC4NLtj7S+kXFg/NePTmk=
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
This directive requires the OpenSSL library enabled in your Nginx build (usually by passing the `--with-http_ssl_module` option to the `./configure` script).
[Back to TOC](#table-of-contents)
set_hmac_sha256
---------------
**syntax:** *set_hmac_sha256 $dst <secret_key> <src>*
**syntax:** *set_hmac_sha256 $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Computes the [HMAC-SHA256](http://en.wikipedia.org/wiki/HMAC) digest of the argument `<src>` and assigns the result into the argument variable `$dst` with the secret key `<secret_key>`.
The raw binary form of the `HMAC-SHA256` digest will be generated, use [set_encode_base64](#set_encode_base64), for example, to encode the result to a textual representation if desired.
For example,
```nginx
location /test {
set $secret 'thisisverysecretstuff';
set $string_to_sign 'some string we want to sign';
set_hmac_sha256 $signature $secret $string_to_sign;
set_encode_base64 $signature $signature;
echo $signature;
}
```
Then request `GET /test` will yield the following output
```
4pU3GRQrKKIoeLb9CqYsavHE2l6Hx+KMmRmesU+Cfrs=
```
Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly.
This directive requires the OpenSSL library enabled in your Nginx build (usually by passing the `--with-http_ssl_module` option to the `./configure` script).
[Back to TOC](#table-of-contents)
set_random
----------
**syntax:** *set_random $res <from> <to>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Generates a (pseudo) random number (in textual form) within the range `[<$from>, <$to>]` (inclusive).
Only non-negative numbers are allowed for the `<from>` and `<to>` arguments.
When `<from>` is greater than `<to>`, their values will be exchanged accordingly.
For instance,
```nginx
location /test {
set $from 5;
set $to 7;
set_random $res $from $to;
echo $res;
}
```
then request `GET /test` will output a number between 5 and 7 (i.e., among 5, 6, 7).
For now, there's no way to configure a custom random generator seed.
Behind the scene, it makes use of the standard C function `rand()`.
This directive was first introduced in the `v0.22rc1` release.
See also [set_secure_random_alphanum](#set_secure_random_alphanum) and [set_secure_random_lcalpha](#set_secure_random_lcalpha).
[Back to TOC](#table-of-contents)
set_secure_random_alphanum
--------------------------
**syntax:** *set_secure_random_alphanum $res <length>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Generates a cryptographically-strong random string `<length>` characters long with the alphabet `[a-zA-Z0-9]`.
`<length>` may be between 1 and 64, inclusive.
For instance,
```nginx
location /test {
set_secure_random_alphanum $res 32;
echo $res;
}
```
then request `GET /test` will output a string like `ivVVRP2DGaAqDmdf3Rv4ZDJ7k0gOfASz`.
This functionality depends on the presence of the `/dev/urandom` device, available on most UNIX-like systems.
See also [set_secure_random_lcalpha](#set_secure_random_lcalpha) and [set_random](#set_random).
This directive was first introduced in the `v0.22rc8` release.
[Back to TOC](#table-of-contents)
set_secure_random_lcalpha
-------------------------
**syntax:** *set_secure_random_lcalpha $res <length>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Generates a cryptographically-strong random string `<length>` characters long with the alphabet `[a-z]`.
`<length>` may be between 1 and 64, inclusive.
For instance,
```nginx
location /test {
set_secure_random_lcalpha $res 32;
echo $res;
}
```
then request `GET /test` will output a string like `kcuxcddktffsippuekhshdaclaquiusj`.
This functionality depends on the presence of the `/dev/urandom` device, available on most UNIX-like systems.
This directive was first introduced in the `v0.22rc8` release.
See also [set_secure_random_alphanum](#set_secure_random_alphanum) and [set_random](#set_random).
[Back to TOC](#table-of-contents)
set_rotate
----------
**syntax:** *set_rotate $value <from> <to>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Increments `$value` but keeps it in range from `<from>` to `<to>`.
If `$value` is greater than `<to>` or less than `<from>` is will be
set to `<from>` value.
The current value after running this directive will always be saved on a per-location basis. And the this saved value will be used for incrementation when the `$value` is not initialized or has a bad value.
Only non-negative numbers are allowed for the `<from>` and `<to>` arguments.
When `<from>` is greater than `<to>`, their values will be exchanged accordingly.
For instance,
```nginx
location /rotate {
default_type text/plain;
set $counter $cookie_counter;
set_rotate $counter 1 5;
echo $counter;
add_header Set-Cookie counter=$counter;
}
```
then request `GET /rotate` will output next number between 1 and 5 (i.e., 1, 2, 3, 4, 5) on each
refresh of the page. This directive may be userful for banner rotation purposes.
Another example is to use server-side value persistence to do simple round-robin:
```nginx
location /rotate {
default_type text/plain;
set_rotate $counter 0 3;
echo $counter;
}
```
And accessing `/rotate` will also output integer sequence 0, 1, 2, 3, 0, 1, 2, 3, and so on.
This directive was first introduced in the `v0.22rc7` release.
[Back to TOC](#table-of-contents)
set_local_today
---------------
**syntax:** *set_local_today $dst*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Set today's date ("yyyy-mm-dd") in localtime to the argument variable `$dst`.
Here's an example,
```nginx
location /today {
set_local_today $today;
echo $today;
}
```
then request `GET /today` will output something like
```
2011-08-16
```
and year, the actual date you get here will vary every day ;)
Behind the scene, this directive utilizes the `ngx_time` API in the Nginx core, so usually no syscall is involved due to the time caching mechanism in the Nginx core.
[Back to TOC](#table-of-contents)
set_formatted_gmt_time
----------------------
**syntax:** *set_formatted_gmt_time $res <time-format>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Set a formatted GMT time to variable `$res` (as the first argument) using the format string in the second argument.
All the conversion specification notations in the standard C function `strftime` are supported, like `%Y` (for 4-digit years) and `%M` (for minutes in decimal). See <http://linux.die.net/man/3/strftime> for a complete list of conversion specification symbols.
Below is an example:
```nginx
location = /t {
set_formatted_gmt_time $timestr "%a %b %e %H:%M:%S %Y GMT";
echo $timestr;
}
```
Accessing `/t` yields the output
```
Fri Dec 13 15:34:37 2013 GMT
```
This directive was first added in the `0.23` release.
See also [set_formatted_local_time](#set_formatted_local_time).
[Back to TOC](#table-of-contents)
set_formatted_local_time
------------------------
**syntax:** *set_formatted_local_time $res <time-format>*
**default:** *no*
**context:** *location, location if*
**phase:** *rewrite*
Set a formatted local time to variable `$res` (as the first argument) using the format string in the second argument.
All the conversion specification notations in the standard C function `strftime` are supported, like `%Y` (for 4-digit years) and `%M` (for minutes in decimal). See <http://linux.die.net/man/3/strftime> for a complete list of conversion specification symbols.
Below is an example:
```nginx
location = /t {
set_formatted_local_time $timestr "%a %b %e %H:%M:%S %Y %Z";
echo $timestr;
}
```
Accessing `/t` yields the output
```
Fri Dec 13 15:42:15 2013 PST
```
This directive was first added in the `0.23` release.
See also [set_formatted_gmt_time](#set_formatted_gmt_time).
[Back to TOC](#table-of-contents)
Caveats
=======
Do not use [$arg_PARAMETER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_), [$cookie_COOKIE](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_cookie_), [$http_HEADER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_) or other special variables defined in the Nginx core module as the target variable in this module's directives. For instance,
```nginx
set_if_empty $arg_user 'foo'; # DO NOT USE THIS!
```
may lead to segmentation faults.
[Back to TOC](#table-of-contents)
Installation
============
This module is included and enabled by default in the [OpenResty bundle](http://openresty.org). If you want to install this module manually with your own Nginx source tarball, then follow the steps below:
Grab the nginx source code from [nginx.org](http://nginx.org/), for example,
the version 1.13.6 (see [nginx compatibility](#compatibility)), and then build the source with this module:
```bash
wget 'http://nginx.org/download/nginx-1.13.6.tar.gz'
tar -xzvf nginx-1.13.6.tar.gz
cd nginx-1.13.6/
# Here we assume you would install you nginx under /opt/nginx/.
./configure --prefix=/opt/nginx \
--with-http_ssl_module \
--add-module=/path/to/ngx_devel_kit \
--add-module=/path/to/set-misc-nginx-module
make -j2
make install
```
Download the latest version of the release tarball of this module from [set-misc-nginx-module file list](http://github.com/openresty/set-misc-nginx-module/tags), and the latest tarball for [ngx_devel_kit](https://github.com/simplresty/ngx_devel_kit) from its [file list](https://github.com/simplresty/ngx_devel_kit/tags).
[Back to TOC](#table-of-contents)
Building as a dynamic module
----------------------------
Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the
`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module)
directive, for example,
```nginx
load_module /path/to/modules/ndk_http_module.so; # assuming NDK is built as a dynamic module too
load_module /path/to/modules/ngx_http_set_misc_module.so;
```
Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org/).
[Back to TOC](#table-of-contents)
Compatibility
=============
The following versions of Nginx should work with this module:
* **1.13.x** (last tested: 1.13.6)
* **1.12.x**
* **1.11.x** (last tested: 1.11.2)
* **1.10.x**
* **1.9.x** (last tested: 1.9.15)
* **1.8.x**
* **1.7.x** (last tested: 1.7.10)
* **1.6.x**
* **1.5.x** (last tested: 1.5.8)
* **1.4.x** (last tested: 1.4.4)
* **1.2.x** (last tested: 1.2.9)
* **1.1.x** (last tested: 1.1.5)
* **1.0.x** (last tested: 1.0.15)
* **0.9.x** (last tested: 0.9.4)
* **0.8.x** (last tested: 0.8.54)
* **0.7.x >= 0.7.46** (last tested: 0.7.68)
If you find that any particular version of Nginx above 0.7.46 does not work with this module, please consider [reporting a bug](#report-bugs).
[Back to TOC](#table-of-contents)
Report Bugs
===========
Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to
1. send a bug report or even patches to the [openresty-en mailing list](https://groups.google.com/group/openresty-en),
1. or create a ticket on the [issue tracking interface](http://github.com/openresty/set-misc-nginx-module/issues) provided by GitHub.
[Back to TOC](#table-of-contents)
Source Repository
=================
Available on github at [openresty/set-misc-nginx-module](http://github.com/openresty/set-misc-nginx-module).
[Back to TOC](#table-of-contents)
Changes
=======
The change logs for every release of this module can be obtained from the OpenResty bundle's change logs:
<http://openresty.org/#Changes>
[Back to TOC](#table-of-contents)
Test Suite
==========
This module comes with a Perl-driven test suite. The [test cases](http://github.com/openresty/set-misc-nginx-module/tree/master/t/) are
[declarative](http://github.com/openresty/set-misc-nginx-module/blob/master/t/escape-uri.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world.
To run it on your side:
```bash
$ PATH=/path/to/your/nginx-with-set-misc-module:$PATH prove -r t
```
You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary.
Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility.
[Back to TOC](#table-of-contents)
Getting involved
================
You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub.
[Back to TOC](#table-of-contents)
Author
======
Yichun Zhang (agentzh) *<agentzh@gmail.com>*, OpenResty Inc.
This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well.
[Back to TOC](#table-of-contents)
Copyright & License
===================
Copyright (C) 2009-2018, Yichun Zhang (章亦春) <agentzh@gmail.com>, OpenResty Inc.
This module is licensed under the terms of the BSD license.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[Back to TOC](#table-of-contents)
See Also
========
* [Nginx Devel Kit](https://github.com/simpl/ngx_devel_kit)
* [The OpenResty bundle](http://openresty.org)
[Back to TOC](#table-of-contents)
|