Two little bugs
mdounin at mdounin.ru
Wed Dec 8 20:42:35 MSK 2010
On Wed, Dec 08, 2010 at 05:29:07PM +0000, Mark Alan wrote:
> On Wed, 8 Dec 2010 17:04:40 +0100, "Piotr Sikora"
> <piotr.sikora at frickle.com> wrote:
> > > 2. using relative path fails:
> > > sudo nginx -c nginx.conf
> > > with error:
> > > [emerg]: open() "/usr/local/nginx/nginx.conf" failed (2: No such
> > > file or directory)
> > It's supposed to fail.
> How come?
> I we have defined --conf-path=/etc/nginx/nginx.conf and that file
> exists at that place;
> I would expect that in case of any trouble at opening the
> config file stated in the command line,
> be it 'nginx -c nginx.conf' or 'nginx
> -c /whatever/path/anyfile-nginx.conf',
> nginx would try an [emerg]: open() "/etc/nginx/nginx.conf",
> not, as it is doing now, an [emerg]: open()
Relative path in -c is resolved from --prefix, that's why you see
"/usr/local/nginx/" + "nginx.conf".
Note that I don't argue if it breaks POLA or not, it's just how it
currently works. I personally think that paths in command line
arguments should be resolved from pwd.
More information about the nginx