Welcome! Log In Create A New Profile

Advanced

Re: Add country region in logs.

Francis Daly
August 28, 2013 08:30PM
On Wed, Aug 28, 2013 at 12:03:48PM -0600, Alex Flex wrote:

Hi there,

I haven't tested this, but...

> I already have the GeoIP db loaded, and an example map for a region as
> follows:
>
> map $geoip_country_code $north_africa {
> default "";
> ##Northern Africa
> DZ 1; #"Algeria"

http://nginx.org/r/map

The "value" does not have to just be "1". It could be, for example,
"NorthAfrica".

> Would anybody kindly offer me an example of how to generate a variable I
> can use in the logging that would print "NorthAfica" if one of the
> countries in the map matched?

$north_africa.

But it might make more sense to call it $continent_region, and let it
take values for the whole world.

f
--
Francis Daly francis@daoine.org

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

Add country region in logs.

Alex Flex August 28, 2013 02:06PM

Re: Add country region in logs.

Francis Daly August 28, 2013 08:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
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