geoip env + lua
mod_geoip environments are not recognized in lua scripts using mod_magnet
@server.modules += ( "mod_geoip" )
geoip.db-filename = "/etc/GeoIP.dat"
server.modules += ( "mod_magnet" )
magnet.attract-physical-path-to = ( "/etc/lighttpd/mooz.lua" )@
lighty.header["Location"] = "http://woot?" .. lighty.env["GEOIP_COUNTRY_CODE"]
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 natethelen over 10 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 over 3 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.
Also available in: Atom