Two little bugs

Mark Alan varia at e-healthexpert.org
Wed Dec 8 20:29:07 MSK 2010


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()
"/usr/local/nginx/nginx.conf"

> > As seen bellow, my --conf-path=/etc/nginx/nginx.conf.
> > Why is nginx trying to open it at /usr/local/nginx/nginx.conf?
> > Is it hard wired at some other place in the code?
> 
> Because you're passing only filename.

It shouldn't matter.
For the sake of portability in whatever filesystem it happens to be,
if in trouble, nginx should look for the config file stated at
--conf-path= not at some pre-wired location, be it /usr/local/nginx/ or
whatever.

Best regards,

M.



More information about the nginx mailing list