summaryrefslogtreecommitdiff
path: root/pod/nginx/variables_in_config.pod
blob: b22ade1f27fd0ba46f9c4ab2accd25f838417c2f (plain)
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
=encoding utf-8


=head1 Name


variables_in_config


=head1



B<Q:>
Is there a proper way to use nginx variables to make sections of
the configuration shorter, using them as macros for making
parts of configuration work as templates?





E<nbsp>





B<A:>
Variables should not be used as template macros. Variables are
evaluated in the run-time during the processing of each
request, so they are rather costly compared to plain static
configuration. Using variables to store static strings is also
a bad idea. Instead, a macro expansion and "include" directives
should be used to generate configs more easily and it can be
done with the external tools, e.g. sed + make or any other
common template mechanism.