[Patch] add -p option to override prefix

Igor Sysoev is at rambler-co.ru
Wed Mar 25 18:56:43 MSK 2009


On Tue, Mar 24, 2009 at 04:46:03PM +0100, J?r?me Loyet wrote:

> I attach a patch which add the -p option to nginx. This option
> overrides the --prefix path and also the $NGX_CONF_PREFIX variable
> which is used as prefix for "include" directives. So, all relative
> path will be prefix with the value of this option.
> 
> I don't know if it covers all cases but it seems ok in my env.
> 
> Why did I want to make such a patch ?
> Because i'll be running several instances of nginx on the same box,
> with similar conf and similar directorys (/path/xx/conf,
> /path/xx/docs, /path/xx/logs, /path/xx/cache, /path/xx/tmp, ...). With
> same conf, I can launch multiple instances of nginx with
> /path/to/nginx -p /path/www, -p /patch/www2, ...
> 
> I could run one instance of nginx with many "server" directives but
> the box is mutualized between clients and clients doesn't want to
> share their instance with others ...
> 
> You could then imagine many cases in which this option could be usefull.

I need to see how -p will affect on directives that use conf prefix
such as "include", "ssl_certficate*", and "auth_basic_user_file".
Historically, nginx had the single prefix (not conf one), but this was
uncomfortably for Linux packages, where now the conf prefix is /etc/nginx,
while default prefix is somewhere in other place.


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





More information about the nginx mailing list