How do I get the value of $ geoip_city_country_name / $ geoip_city of http_geoip_module in lua file?

43 views
Skip to first unread message

xlingit

unread,
Dec 22, 2017, 9:16:19 AM12/22/17
to openresty-en
How do I get the value of $ geoip_city_country_name / $ geoip_city of http_geoip_module in lua file?


 



 

Igor Clark

unread,
Dec 22, 2017, 12:14:33 PM12/22/17
to openre...@googlegroups.com
As long as ngx_http_geoip_module is loaded into OpenResty, you can refer directly to it as ngx.var.geoip_city_country_name - see https://github.com/openresty/lua-nginx-module/#ngxvarvariable

:-)


On 22/12/2017 14:16, xlingit wrote:
How do I get the value of $ geoip_city_country_name / $ geoip_city of http_geoip_module in lua file?


 



 

--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xlingit

unread,
Dec 24, 2017, 9:45:29 PM12/24/17
to openre...@googlegroups.com


but cat not get the value,'geoip_city_country_name' (a nil value)
    1)ngx_http_geoip_module has loaded
   
   2) geo date files has get 



but the log error,such as:

xlingit

unread,
Dec 25, 2017, 1:54:09 AM12/25/17
to xlingit, openre...@googlegroups.com
it is ok ,'geoip_city_country_name' is nil just because local area network.thank you @igor....@gmail.com


Reply all
Reply to author
Forward
0 new messages