httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Kuhn <>
Subject [users@httpd] Using mod_lua as OutputFilter and status != 200
Date Mon, 10 Sep 2018 18:54:30 GMT


using mod_lua (httpd: 2.4.34) for rewriting my outgoing content by

LuaOutputFilter MyOutputFilter "/my/lib/lua/output-filter.lua" output_filter
SetOutputFilter MyOutputFilter

works great when the webserver returns content with status 200.
Sadly the output_filter-function is not getting called when httpd is 
redirecting content (301 or 302) or sends a 403.
Is that a bug in httpd/mod_lua or a wrong usage of mine?
The relevant config looks like:

LoadModule lua_module modules/
LuaOutputFilter MyOutputFilter "/my/lib/lua/output-filter.lua" output_filter
SetOutputFilter MyOutputFilter
Redirect /test1.html /test1
RewriteEngine On
RewriteRule ^/test2.html$ /test2 [R=301,L]
RewriteRule ^/test3.html$ /test3 [R=302,L]
RewriteRule ^/test4.html$ - [F,L]

in /my/lib/lua/output-filter.lua I have:
function output_filter(r)
    r:err("Got called.")

Accesing[N].html redirects or returns a 403, but 
the output_filter-function gets never called.
(I also renamed 'output_filter' to 'MyOutputFilter' but that changed 

If I disable mod_lua, load mod_perl instead, and use 
PerlOutputFilterHandler for rewriting the output httpd will call that 
output filter at every status!
Any ideas what's going on here?

Best regards for any hints,

P.S.: Is there a reason why "AddOutputFilterByType MyOutputFilter 
text/html" does never work, while e.g. "AddOutputFilterByType DEFLATE 
text/html" does? Is the filter functionality of mod_lua broken?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message