On 1/16/25 11:27, Marc wrote:
I have currently some abuse page that notifies the ip is blocked. I am 
generating this page with php because I want to display the ip adres on this 
page. Is there a more efficient way to generate a page with one line of text 
and the blocked ip address?
Maybe directly in apache without using php-fpm?

You can do just about anything you like with mod_lua, including rate limiting, custom block messages, and more.

If you already know that an IP is supposed to be blocked, you can use the LuaQuickHandler[1] to serve up a message before any other processing happens in httpd (a quick handler fires as soon as a request is mapped to a virtual host, but before any file-system/rewrite/auth/whatever runs).

If you'd rather do it as a filter on responses, you can use the LuaOutputFilter[2] directive and set up a filter.

We make use of both of those at the ASF itself for rate- and bandwidth- limiting on select services, and it works well.

[1] https://httpd.apache.org/docs/trunk/mod/mod_lua.html#luaquickhandler
[2] https://httpd.apache.org/docs/trunk/mod/mod_lua.html#luaoutputfilter


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to