Welcome! Log In Create A New Profile

Advanced

Re: use

Gena Makhomed
July 23, 2011 12:26PM
On 06.07.2011 12:56, Gena Makhomed wrote:

> предложение по дальнейшему развитию/улучшению nginx.
> Игорь, хотелось бы узнать Ваше мнение по этому вопросу.

вот дополнение к тому первому, моему оригинальному сообщению:

-------- Original Message --------
Subject: use
Date: Sat, 23 Jul 2011 19:17:08 +0300
From: Gena Makhomed <gmm@csdoc.com>
To: nginx-devel@nginx.org

On 23.07.2011 17:42, António P. P. Almeida wrote:

>> Igor, likely nginx now need something like httpd mod_macro
>> to eliminate multiple duplicates of small config fragments

> I followed the discussion on the russian ML. Yes something like your
> use suggestion would be great.

that my message in russian ML: http://www.lexa.ru/nginx-ru/msg41221.html

in that proposal I make one mistake: "local" site config files also
includes in main nginx.conf config via include directive, for example

include /etc/nginx/virtual/*.conf;

and all blocks will have global scope after this include in nginx.conf
now I can see only three solutions:

1. make two include-like directives, for example, 'include'
and 'require' - one inherit blocks/macros from included files
and one - not inherit.

2. make two block/macro-like directives, one with strict scope
to one local config file and one - with scope extendible by include.

3. allow silently overwrite prevous defined macros (DANGEROUS)

I think the best way for solution is two include-like directives:
'include' directive - leave intact, and new 'require' directive -
do not import any block/macro definitions from included files.

in this case - all 'global' include-files with block/macro
definitions will be included in 'local' site configuration
files via dumb include directive, and all 'local' site config
files will be included in main nginx.conf via require directive:

require /etc/nginx/virtual/*.conf;

in this case - any 'local' site config file can have its own
blocks/macros with same names, as in other 'local' site config
files, and all errors with accidental macro redefinitions
will be easy detected at phrase of nginx config parsing.

and my original proposal also add to nginx third variant
of include-like directive: 'use' - for block/macro substitution,
like in mod_macro - http://www.cri.ensmp.fr/~coelho/mod_macro/

================================================================

also httpd mod_macro is feature-rich - it have macro arguments.
same feature can be implemented also for nginx. for example:

define macro_name {...} - macro without arguments

define macro_name( ARG1, ARG2, ARG3, ... ) {...} - macro with arguments

'define' - new nginx keyword instead of 'block' (as in original message)
this is something like well known C-preprocessor #define directive.
because nginx have C-like syntax, not html-like, as apache one.

================================================================

for now - this is my current version of
proposal for three new nginx directives: define / use / require

happen what 1/2 text of my proposal - in russian language,
and 1/2 - in english language (probably with many errors).

--
Best regards,
Gena

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Re: Настройка nginx + passenger с разными production environments

Роман Москвитин July 11, 2011 09:02AM

use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Роман Москвитин July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Илья Пирогов July 11, 2011 09:02AM

Re: use

Un Lexx July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Un Lexx July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Alexandr Gomoliako July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Alexandr Gomoliako July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Sergey Shepelev July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Роман Москвитин July 11, 2011 09:02AM

Re: use

Gena Makhomed July 11, 2011 09:02AM

Re: use

Pavel V. July 11, 2011 10:16AM

Re: use

Gena Makhomed July 11, 2011 10:58AM

Re: use

Pavel V. July 11, 2011 01:02PM

Re: use

Gena Makhomed July 11, 2011 01:38PM

Re: use

Boris Dolgov July 16, 2011 04:16PM

Re: use

Gena Makhomed July 16, 2011 04:28PM

Re: use

Gena Makhomed July 23, 2011 12:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready