Macro functionality

using apache and mod_macro is it easy to setup a block of config, that
can be reused, and makes maintaining complicated configurations
possible. Is there anything for nginx like this ?

Best Regards

Jools

Is it is easy to use mod_macro in apache? You never really made that
clear.

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!

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

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 :frowning:

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 :slight_smile:

– Merlin