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

ngx_http_naxsi_module.so cannot open shared object #521

Closed effen1337 closed 4 years ago

effen1337 commented 4 years ago

After installing naxsi and setting it up with nginx, I'm not being redirected to the error page at all and when checking logs, i find:

2020/09/22 15:39:16 [emerg] 32083#32083: dlopen() "/etc/nginx/modules/ngx_http_naxsi_module.so" failed (/etc/ng inx/modules/ngx_http_naxsi_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/ nginx.conf:5

I do have the ngx_http_naxsi_module.so in nginx/modules though?

wargio commented 4 years ago

How you have built naxsi? are you on debian/ubuntu? looks like there is a mismatch between the nginx version and the naxsi module or you have failed to install it.

effen1337 commented 4 years ago

How you have built naxsi? are you on debian/ubuntu? looks like there is a mismatch between the nginx version and the naxsi module or you have failed to install it.

downloaded both nginx and naxsi, configured inside nginx and had the ngx_http_naxsi_module.so in objs/ moved it to /etc/nginx/modules moved naxsi_core.rules to /etc/nginx loaded the ngx_http_naxsi_module.so, added the naxsi_core.rules to http block and ofc enabled it in learning mode and all that inside location block

Ubuntu, how would a mismatch happen?

wargio commented 4 years ago

i'm sure there is a mismatch between your nginx version and the one that you use from apt. i suggest to try the 1.1 pre-release (see releases) version or build it via the apt-source nginx sources

effen1337 commented 4 years ago

i'm sure there is a mismatch between your nginx version and the one that you use from apt. i suggest to try the 1.1 pre-release (see releases) version or build it via the apt-source nginx sources

to be fair, i downloaded the latest naxsi version (master) but nginx is on 1.18. I don't remember seeing anything about a mismatch, alright ill try

wargio commented 4 years ago

the mismatch happens with the .so file.

wargio commented 4 years ago

can i close this?

effen1337 commented 4 years ago

Yeah, issue resolved!