0

Is it possible to use any of the following HTTP servers: Apache, Nginx or Lighttpd as a proxy to make the following:

  • Disallow certain HTTP bodies (web pages) based on their content (e. g., words)
  • Substitute certain content with another (e. g., by regular expression)

Not only core functionality but also modules may be used. Also, I may consider writing my own module, so the question would be then if it's easy to write such a module for any of these servers.

I know that Squid + DansGuardian/SquidGard allow this but I am interested in mentioned software.

user444214
  • 111
  • 4

2 Answers2

1

I think I may answer my question myself. Personally I ended up using Apache mod_ext_filter module. It allows to use a custom program which gets the content from standard input and outputs what it likes based on input. So disallowing content may be done through outputting something like "Forbidden" if input is inappropriate.

Also there are Apache modules mod_sed and mod_line_edit for editing the content.

I didn't use other servers but it seems, like sendmoreinfo suggests, that HttpSubModule may be used for Nginx. As for lighttpd, this and this answers have some information.

user444214
  • 111
  • 4
0

nginx stock module ngx_http_sub_module supports simple search and replace.

sendmoreinfo
  • 1,742
  • 12
  • 33