Mercurial > hg > nginx-site
comparison xml/en/docs/faq/variables_in_config.xml @ 198:ec4626d04879
- Bulk commit following discussion in devrep
author | Andrey Alexeev <andrew@nginx.com> |
---|---|
date | Wed, 23 Nov 2011 16:31:50 +0000 |
parents | aafe530e7d6f |
children | be54c443235a |
comparison
equal
deleted
inserted
replaced
197:241c9db1f3f4 | 198:ec4626d04879 |
---|---|
1 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd"> | 1 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
2 | 2 |
3 <article name="Is there a proper way to use nginx variables to | 3 <article name="Is there a proper way to use nginx variables to |
4 make sections of the configuration shorter, | 4 make sections of the configuration shorter, |
5 using them as macros for making | 5 using them as macros for making |
6 parts of configuration work as templates?" | 6 parts of configuration work as templates?" |
24 <initial>A:</initial> | 24 <initial>A:</initial> |
25 Variables should not be used as template macros. Variables are | 25 Variables should not be used as template macros. Variables are |
26 evaluated in the run-time during the processing of each | 26 evaluated in the run-time during the processing of each |
27 request, so they are rather costly compared to plain static | 27 request, so they are rather costly compared to plain static |
28 configuration. Using variables to store static strings is also | 28 configuration. Using variables to store static strings is also |
29 a bad idea. Instead, a macro expansion should be used to | 29 a bad idea. Instead, a macro expansion and "include" directives |
30 generate configs more easily and it can be done with the | 30 should be used to generate configs more easily and it can be |
31 external tools, e.g. sed + make or any other common template | 31 done with the external tools, e.g. sed + make or any other |
32 mechanism. | 32 common template mechanism. |
33 </para> | 33 </para> |
34 | 34 |
35 </section> | 35 </section> |
36 | 36 |
37 </article> | 37 </article> |