macro functionality

merlin corey merlincorey at
Sat Jun 27 11:59:52 MSD 2009

I am suggesting that dynamic configuration is more complicated than
the fully specified, verbose, redundant configuration - as well as
less efficient.

Also, I do not want to see a half-baked macro language in nginx's
configuration language.  What you think of as macros is not what I
think of as macros (as a lisp programmer), and it sounds more like you
just want functions that output configuration snippets.

I am suggesting that since this is not in NginX's configuration
language you can easily make use of existing programming and scripting
languages to generate your configurations as needed.  It simply adds
another step before rehashing/starting which can easily be wrapped
into a makefile or init script so it is still one command.  Also, it
gives you the power, comfort, and familiarity of your language of
choice, rather than some new, embedded language in NginX that we all
have to learn and test.

Adding these kinds of constructs implicates some kind of extra
resources being used, and don't we want our nginx's to be as
lightweight as possible?

Just some thoughts :)

-- Merlin

On Fri, Jun 26, 2009 at 11:13 AM, Michael Shadle<mike503 at> wrote:
> I'd like macro support too
> Even if it's just for making the $document_root dynamic, which can be
> done but apparently does not affect the variable itself :(
> On Fri, Jun 26, 2009 at 5:52 AM, Jools Wills<buzz at> wrote:
>>> Is it is easy to use mod_macro in apache?  You never really made that
>>> clear.
>> Sorry. I wrote "is it" instead of "it is". I mean't it is easy and I miss
>> this after moving to nginx.
>>> NginX prefers to make use of include where necessary, and it is more
>>> efficient with fully specified configurations.  Some people with very
>>> large or complicated configurations use makefiles or other scripts to
>>> generate configuration files.  This seems to work well for them!
>> I use includes, but I would like to pass parameters, so i could have a
>> simple "virtualhost" include that setup logfile defaults in certain
>> locations depending on some parameter? or can this be done somehow with
>> variables?
>> Best Regards
>> Jools
>> --
>> (Formerly known as Jools Smyth)

More information about the nginx mailing list