File: list

package info (click to toggle)
nginx 1.18.0-6.1%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,344 kB
  • sloc: ansic: 250,653; perl: 7,548; sh: 1,408; ruby: 879; python: 358; makefile: 338; awk: 36; cpp: 18
file content (45 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (15)
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

NDK_UPSTREAM_LIST
-----------------

This submodule provides a directive that creates a list of upstreams, with
optional weighting. This list can then be used by other modules to hash over
the upstreams however they choose.


USAGE IN CONF FILE
------------------

e.g. upstream_list   name    backend1  4:backend2    3:backend3;



USAGE WITH OTHER MODULES
------------------------

Add a line like

CFLAGS="$CFLAGS -DNDK_UPSTREAM_LIST"

to the config file of your module.



INTEGRATING WITH YOUR MODULE
----------------------------

The upstream lists are stored in the array given in the lists.h file, which is
an array of ndk_upstream_list_t elts.  The elts are currently all pointers to 
strings which have been distributed according to the weight - so if there are
two backends, with weight 3 and 4 respectively, there will be 7 pointers in
total with the first 3 pointing to the first backend and the last 4 to the 
second.



TODO
----
-   replace strings with pointers to upstreams if they are available (and if 
    this is possible)
-   add additional 'http://' to strings if necessary
-   improve this documentation