1

for nginx there's a very nice module available to filter a response and search/replace content in it: http://wiki.nginx.org/HttpSubModule

i wonder, if there's a similar possibility for lighttpd available?

thanks in advance,

2 Answers 2

1

Current 1.4.x release default modules seem to miss that functionality but as far as this page goes it could be supported in some future 1.5.x release i na module named mod_layout.

2
  • mod_layout seems to be exactly what i am looking for. but is 1.5 already "usable"? normally i don't have a problem using beta-quality software, but it should be somehow stable that i am able to deploy it in a live environment without having to restart it over and over again ;)
    – harald
    Jan 26, 2011 at 12:14
  • lighttpd 1.5.x branch has been abandoned. Some solutions are possible using lighttpd mod_magnet. See answer below.
    – gstrauss
    Jun 12, 2023 at 21:12
0

Take a look at AbsoLUAtion examples. lighttpd with mod_magnet and Lua scripting can do all kind of complex content modifications.

4
  • yes, mod_magnet is very cool -- i am already using it for several complex rewriting / redirection stuff. but as far as i know it can only handle a request but not the response.
    – harald
    Jan 26, 2011 at 12:11
  • harald: That's why I pointed you out the AbsoLUAtion examples. Take a look at code snippets there, such as "Sending text files as HTML" or "Selecting a random file from a directory", which both modify the content. Would those examples lead you to right direction? Jan 26, 2011 at 12:16
  • the problem is, that i have to replace some content in the response of a web application running using fastCGI. all i can find in the examples is about header-manipulation and static content loading.
    – harald
    Jan 26, 2011 at 12:23
  • lighttpd mod_magnet in lighttpd 1.4.56 and later support magnet.attract-response-start-to where you can rewrite the response IFF lighttpd is configured for response offloading (the default) which collects the response from the backend before sending it to the client (instead of being configured to stream the response to the client as the response is produced from the backend).
    – gstrauss
    Jun 12, 2023 at 21:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .