nbs-system / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
GNU General Public License v3.0
4.8k stars 606 forks source link

access-denied URL, return more than just status code i.e. Lua file. #345

Closed ciarans closed 7 years ago

ciarans commented 7 years ago

Is it possible for naxsi to return the contents of a Lua file and not just a status code with the DeniedUrl? Of not Lua then maybe a specific static file?

DeniedUrl "/naxsi-request-denied";

location /naxsi-request-denied {
 access_by_lua_file 'lualib/naxsi.lua';
}

I have even tried but the page just hangs

error_page 406 /406.html;

location /naxsi-request-denied {
    return 406;
}

location = /406.html {
   root html/error-pages/;
   internal;
 }

I can only get it to return by reoving the custom 406.

buixor commented 7 years ago

Hello,

@ciarans : if you do the same without naxsi, does it work ? Didn't try myself, but I can give it a shot :)

blotus commented 7 years ago

Hello,

I just tested it with the latest release (0.55.1), and it's working fine, which version are you using ? Do you have other 3rd party modules ? (On a sidenote, if you only want to generate the response from a lua file, i think content_by_lua_file is more appropriate than access_by_lua_file)

buixor commented 7 years ago

Closing, @ciarans : re-open if you still encounter the issue :)