Welcome! Log In Create A New Profile

Advanced

Re: "access_log" directive is not allowed here in... how to do this properly?

Francis Daly
March 25, 2012 08:06PM
On Sun, Mar 25, 2012 at 11:40:51PM +0000, Micheal Wolfskill wrote:

Hi there,

> > access_log /root/$log.log;
>
> I did. No errors.. but its not writing any log file at all...

What does error_log say?

When I try to write to a new file in /root/ as a non-root nginx user,
I see something like

open() "/root/default.log" failed (13: Permission denied)

> I think this defeats the purpose... because I only want to log for when the IP of the remote user matches any of those countries in the http {} section.
>

Probably something like

map $geoip_country_code $mylogfile {
default off;
CN logs/access.log;
}
access_log $mylogfile;

will work, then.

"log normally and post-process" is always another option, of course.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

"access_log" directive is not allowed here in... how to do this properly?

Micheal Wolfskill March 25, 2012 03:22PM

Re: "access_log" directive is not allowed here in... how to do this properly?

Francis Daly March 25, 2012 06:34PM

RE: "access_log" directive is not allowed here in... how to do this properly?

Micheal Wolfskill March 25, 2012 06:44PM

Re: "access_log" directive is not allowed here in... how to do this properly?

Francis Daly March 25, 2012 07:10PM

RE: "access_log" directive is not allowed here in... how to do this properly?

Micheal Wolfskill March 25, 2012 07:16PM

Re: "access_log" directive is not allowed here in... how to do this properly?

Francis Daly March 25, 2012 07:22PM

RE: "access_log" directive is not allowed here in... how to do this properly?

Micheal Wolfskill March 25, 2012 07:42PM

Re: "access_log" directive is not allowed here in... how to do this properly?

Francis Daly March 25, 2012 08:06PM

Re: "access_log" directive is not allowed here in... how to do this properly?

Alexander Kolesen March 25, 2012 07:30PM

RE: "access_log" directive is not allowed here in... how to do this properly?

Micheal Wolfskill March 25, 2012 08:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 109
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready