【发布时间】:2013-07-03 13:56:59
【问题描述】:
我使用参数“--with-http-geoip-module”成功编译了NGINX和geoip模块。
数据库在我的 nginx.conf 文件中显示。
http{
....
geoip_country /usr/lib/local/geoip.dat;
....
}
一切似乎都很好,这个模块加载没有错误。
我已将自己的模块添加到 NGINX 中。 我尝试从 geo 模块查询 geoip_country_code 变量。
static ngx_int_t
ngx_http_cms_url_handler(ngx_http_request_t *r)
{
ngx_str_t variable_name = ngx_string("geoip_country_code");
ngx_http_variable_value_t * geoip_country_code_var = ngx_http_get_variable( r, &variable_name, 0);
ngx_log_debug( NGX_LOG_INFO, r->connection->log, 0, "ngx_http_get_variable[%d]", geoip_country_code_var->not_found);
}
not_found始终为1,无法获取位置信息。
有谁知道问题出在哪里?
【问题讨论】: