简体   繁体   English

Nginx 和 ModSecurity

[英]Nginx and ModSecurity

I'm having a strange issue with Ubuntu 18.04 and Nginx with ModSecurity.我在使用 ModSecurity 的 Ubuntu 18.04 和 Nginx 时遇到了一个奇怪的问题。 I've compiled everything correctly and it's working when activating the ModSecurity module, however whenever I activate a rule, I get the following:我已经正确编译了所有内容,并且在激活 ModSecurity 模块时它正在工作,但是每当我激活规则时,我都会得到以下信息:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

Nginx crashes and doesn't serve the page - any ideas? Nginx 崩溃并且不提供页面 - 有什么想法吗?

I'm having this issue in Ubuntu 16.04 as well.我在 Ubuntu 16.04 中也遇到了这个问题。 This seems to be an issue with the latest version of ModSecurity as seen in this bug: https://github.com/SpiderLabs/ModSecurity/issues/2180这似乎是最新版本的 ModSecurity 的问题,如此错误所示: https://github.com/SpiderLabs/ModSecurity/issues/2180

If you downloaded ModSecurity via git, you can use this command to get back to a working version:如果您通过 git 下载了 ModSecurity,则可以使用此命令恢复到工作版本:

git reset --hard d5b93c1013ca9c9a96c75369576b54832e9a2b48

Then clean your ModSecurity build directory and build it again.然后清理您的 ModSecurity 构建目录并再次构建它。 Once you have ModSecurity rebuild, restart nginx.重建 ModSecurity 后,重新启动 nginx。 Once the above bug is closed in GitHub, it will probably be safe to update to the latest version again.一旦在 GitHub 中关闭了上述错误,再次更新到最新版本可能是安全的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM