Mercurial > hg > nginx-site
annotate xml/en/docs/faq/variables_in_config.xml @ 386:62468b793748
ec2 howto added
author | Sergey Budnevitch <sb@waeme.net> |
---|---|
date | Thu, 02 Feb 2012 09:28:47 +0000 |
parents | ec4626d04879 |
children | be54c443235a |
rev | line source |
---|---|
198
ec4626d04879
- Bulk commit following discussion in devrep
Andrey Alexeev <andrew@nginx.com>
parents:
196
diff
changeset
|
1 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
196
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
2 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
3 <article name="Is there a proper way to use nginx variables to |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
4 make sections of the configuration shorter, |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
5 using them as macros for making |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
6 parts of configuration work as templates?" |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
7 link="/en/docs/faq/variables_in_config.html" |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
8 lang="en"> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
9 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
10 <section> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
11 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
12 <para> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
13 <initial>Q:</initial> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
14 Is there a proper way to use nginx variables to make sections of |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
15 the configuration shorter, using them as macros for making |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
16 parts of configuration work as templates? |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
17 </para> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
18 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
19 <para> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
20 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
21 </para> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
22 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
23 <para> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
24 <initial>A:</initial> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
25 Variables should not be used as template macros. Variables are |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
26 evaluated in the run-time during the processing of each |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
27 request, so they are rather costly compared to plain static |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
28 configuration. Using variables to store static strings is also |
198
ec4626d04879
- Bulk commit following discussion in devrep
Andrey Alexeev <andrew@nginx.com>
parents:
196
diff
changeset
|
29 a bad idea. Instead, a macro expansion and "include" directives |
ec4626d04879
- Bulk commit following discussion in devrep
Andrey Alexeev <andrew@nginx.com>
parents:
196
diff
changeset
|
30 should be used to generate configs more easily and it can be |
ec4626d04879
- Bulk commit following discussion in devrep
Andrey Alexeev <andrew@nginx.com>
parents:
196
diff
changeset
|
31 done with the external tools, e.g. sed + make or any other |
ec4626d04879
- Bulk commit following discussion in devrep
Andrey Alexeev <andrew@nginx.com>
parents:
196
diff
changeset
|
32 common template mechanism. |
196
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
33 </para> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
34 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
35 </section> |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
36 |
aafe530e7d6f
- Added faq/ and more q&a as previously agreed
Andrey Alexeev <andrew@nginx.com>
parents:
diff
changeset
|
37 </article> |