Set a variable in configuration file

Igor Sysoev is at rambler-co.ru
Fri Sep 12 00:35:09 MSD 2008


On Wed, Sep 10, 2008 at 05:06:45PM +0200, Thomas wrote:

> Here is an excerpt of my conf file:
> ---
>   set $ngx_path         /usr/local/nginx/logs;
>   set $app_path       /home/application;
> ...
>     root                $app_path/myblog;
>     access_log    $ngx_path/access.myblog.log;
> ---
> 
> And here is the error message I get when I start nginx:
> ------
> 2008/09/10 17:01:11 [emerg] 588#0: open()
> "/usr/local/nginx/$ngx_path/access.myblog.log" failed (2: No such file
> or directory)
> ------
> 
> Setting a path variable doesn't work with the log files.

access_log supports variables since 0.7.6+ only.

BTW, it's not good idea to set some variable to static values on server
level and then use them. You may simply define common "root" and "access_log"
on server level.


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





More information about the nginx mailing list