set variables within config

Igor Sysoev is at rambler-co.ru
Fri May 15 09:17:37 MSD 2009


On Thu, May 14, 2009 at 01:39:26PM -0700, Michael Shadle wrote:

> On Thu, May 14, 2009 at 12:32 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> 
> > As of now nginx has no variables expanded during config loading -
> > everything expaneded during request processing.  So using
> > variables just to save some config lines is somewhat stupid as it
> > means wasting lots of CPU time for every request.
> >
> > If you really need to simplify configs - it's easy to generate
> > them using make and sed.
> 
> This might be what Igor meant by "configuration macros"?

No, by "configuration macros" I meant nginx built-in macros, but not
using exteranl tools such as make, sed, etc.

One of the problem is how to distinguish syntactically these future macros
from run-time variables, i.e.

   root  $root;
   root  ${root};

vs

   root  %root;
   root  %{root};

or something else.

> Interesting. Will have to examine if I am abusing variables that much
> in real-time in my configurations!


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list