Bug #1976
closedgeoip env + lua
Description
Hi there
mod_geoip environments are not recognized in lua scripts using mod_magnet
lighttpd.conf:
@server.modules += ( "mod_geoip" )
geoip.db-filename = "/etc/GeoIP.dat"
server.modules += ( "mod_magnet" )
magnet.attract-physical-path-to = ( "/etc/lighttpd/mooz.lua" )@
mooz.lua:
lighty.header["Location"] = "http://woot?" .. lighty.env["GEOIP_COUNTRY_CODE"]
return 302
error log:
2009-05-07 10:00:14: (mod_magnet.c.765) lua_pcall(): /etc/lighttpd/mooz.lua:5: attempt to concatenate field 'GEOIP_COUNTRY_CODE' (a nil value)
As you see mod_geoip is loaded before mod_magnet, but mod_geoip is not setting the env variables properly, or maybe mod_magnet couldn't use them
Updated by stbuehler over 15 years ago
- Status changed from New to Invalid
I still don't see a mod_geoip upstream. and lighty.env is not the environment (it should be renamed "lighty.req-data" or something like that).
Updated by natethelen over 15 years ago
I am also seeing this using fast-cgi and flup (python). I have traced it back to the raw socket read and none of the GEOIP_* FCGI_PARAMS are being sent through. What is weird is that they are passed through to PHP when run via fast-cgi with all else equal on the same box
Updated by gstrauss about 8 years ago
- Related to Feature #1546: Enhancements for mod_geoip added
Updated by gstrauss about 8 years ago
mod_geoip currently hooks subrequest_start, where the geoip info is then available to dynamic handlers such as mod_cgi, mod_fastcgi, mod_scgi.
mod_geoip in the subrequest_start hook runs after mod_magnet, which runs in earlier hooks in the request.
See #1546 for further explanation.
Updated by gstrauss over 3 years ago
- ASK QUESTIONS IN Forums set to No
FYI: since lighttpd 1.4.45 (Jan 2017), lighttpd populates the request env on demand for dynamic modules, including mod_magnet, so info from mod_maxminddb (successor to mod_geoip) is available in mod_magnet
Also available in: Atom