Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I read that Apache 2.2 has a new mod to patch outputs on the fly.

mod_substitute provides a mechanism to perform both regular expression and fixed string substitutions on response bodies.

The feature is useful when I setup testing/development environment. I can replace hostname without touching the content/code.

How can I do similar configuration in lighttpd?

share|improve this question

As far as I know, there is no such solution.

Well, that's not entirely true. You can use a Lua script with mod_magnet to build or the HTTP body output, in a manner. However, it hasn't been optimized for that sort of usage, so it's not recommended. It may do the job in a pinch, however.

If this functionality is absolutely vital and you don't want to switch to Apache to use it, would switching to nginx be an option? It has a substitution module.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.