1

I have an app that uses lighttpd to log requests to a pixel, but the client doesn't need any response. Currently the requests map to a small static image. Is there a way to configure lighttpd to respond to these requests with a 204 header without using any fcgi/etc handler? I.e. done purely by the lighty server itself?

yacomink
  • 113
  • 5

2 Answers2

4

Lighttpd doesn't seem to have an option to do this, so the only way would be to write a Lua script using mod_magnet. The script shouldn't require more than this:

return 204

And the corresponding configuration:

server.modules += ( "mod_magnet" )
$HTTP["url"] == "/somepath" {
    magnet.attract-raw-url-to = ( "/etc/lighttpd/204.lua" )
}
mgorven
  • 30,615
  • 7
  • 79
  • 122
0

Did you try using: setenv.add-response-header = ()? (This requires "mod_setenv")

Aleksey Korzun
  • 276
  • 1
  • 4