owasp-modsecurity / ModSecurity-nginx

ModSecurity v3 Nginx Connector
Apache License 2.0
1.48k stars 274 forks source link

getting error while starting ngnix server #301

Closed gk6301965 closed 1 year ago

gk6301965 commented 1 year ago

"/usr/share/nginx/modules/ngx_http_modsecurity_module.so" version 1019001 instead of 1018000 in /etc/nginx/nginx.conf Above is the error I am getting plaese help

martinhsv commented 1 year ago

Hello @gk6301965 ,

That sort of error message can appear if you have mismatched versions of nginx.

I.e. if the version of nginx that you are running (e.g. nginx -v) does not match the version of nginx that was used when the ngx_http_modsecurity_module was built.

gk6301965 commented 1 year ago

Hello @gk6301965 ,

That sort of error message can appear if you have mismatched versions of nginx.

I.e. if the version of nginx that you are running (e.g. nginx -v) does not match the version of nginx that was used when the ngx_http_modsecurity_module was built.

but how to slove this

martinhsv commented 1 year ago

When you are following instructions for the ModSecurity-nginx connector, there will be a step where you download the nginx source. This will be where you do make modules The version of the source code that you downloaded must be the same as the version of nginx that you are actually running.

See for example https://www.nginx.com/blog/compiling-and-installing-modsecurity-for-open-source-nginx/#4 %E2%80%93-Download-the-NGINX-Connector-for-ModSecurity-and-Compile-It-as-a-Dynamic-Module

martinhsv commented 1 year ago

Closing due to no further feedback.