Can nginx.conf use relative paths?
roxis at list.ru
Tue Aug 26 20:04:05 MSD 2008
On Tuesday 26 August 2008, Sven C. Koehler wrote:
> On Tue, Aug 26, 2008 at 10:16:19PM +0700, Chris Savery wrote:
> > common.nginx.conf not same as common.conf
> Ok, I fixed the spelling, but the error remains:
> | /tmp/ng $ cat ng.conf
> | include common.conf;
> | pid nginx.pid;
> | /tmp/ng $ cat common.conf
> | # empty
> | /tmp/ng $ /usr/sbin/nginx -c ng.conf
> | 2008/08/26 15:32:55 [emerg] 14789#0: open() "/etc/nginx/common.conf"
> | failed (2: No such file or directory) in ng.conf:1
> | /tmp/ng $ /usr/sbin/nginx -v
> | nginx version: nginx/0.7.7
> The wiki documentation on
> http://wiki.codemongers.com/NginxMainModule#include says that "since
> version 0.6.7, paths are relative to directory of nginx configuration
> file nginx.conf, but not to nginx prefix directory." -- so could it be
> that nginx is broken on Gentoo?
nginx don't uses cwd but path selected by configure script
in your case it is "/etc/nginx"
so "include common.conf;" will include "/etc/nginx/common.conf"
and not "$PWD/common.conf"
More information about the nginx