Welcome! Log In Create A New Profile


Variables in access_log

July 03, 2009 09:28AM
From http://wiki.nginx.org/NginxHttpLogModule
The log file path can contain variables (version >=0.7.4) ..

[code] nginx -v
nginx version: nginx/0.7.59[/code]

Config snippet:
set $client $host;
if ($client ~ "^([a-z0-9]*).admin.mysite.com"){
set $client $1;
root /var/www/wordpress/$client/admin;

location / {
access_log /var/log/nginx/wordpress/admin/$client/generic-access.log;
error_log /var/log/nginx/wordpress/admin/$client/generic-error.log;

Fails on test:
nginx -t
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
[emerg]: open() "/var/log/nginx/wordpress/admin/$client/generic-error.log" failed (2: No such file or directory)
configuration file /usr/local/nginx/conf/nginx.conf test failed

Have I misunderstood?
Subject Author Posted

Variables in access_log

miradev July 03, 2009 09:28AM

Re: Variables in access_log

Brent Bloxam July 03, 2009 10:43AM

Re: Variables in access_log

miradev July 07, 2009 05:44AM

Re: Variables in access_log

batrick July 05, 2009 05:40AM

Re: Variables in access_log

merlin corey July 06, 2009 08:41PM

Re: Variables in access_log

miradev July 07, 2009 05:53AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready