mitchellkrogza / nginx-ultimate-bad-bot-blocker

Nginx Block Bad Bots, Spam Referrer Blocker, Vulnerability Scanners, User-Agents, Malware, Adware, Ransomware, Malicious Sites, with anti-DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders
Other
3.81k stars 472 forks source link

[BUG] Doesn't add includes to every server directive in a config file #537

Closed fluffy-critter closed 7 months ago

fluffy-critter commented 7 months ago

Describe the bug

Sometimes a server configuration will have multiple declared server blocks within a config file, for example having separate configurations for multiple related subdomains. setup-ngxblocker seems to assume that only the bottommost server directive needs to be modified.

To Reproduce

Steps to reproduce the behavior:

  1. Have a configured site with multiple subdomain configurations in a single .conf
  2. Run setup-ngxblocker

Expected behavior

Every server block should have the ngxblocker configuration includes.

Server (please complete the following information):


Linux nautilus.e-snail.us 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

nginx version: nginx/1.18.0 (Ubuntu)

Paste any log / error messages here (paste in between the ```     ``` markers)

Additional information

Add any other context about the problem here.

fluffy-critter commented 7 months ago

Actually it looks like I was incorrect, it's actually failing to add configuration to my sites that use proxy_pass. I'm guessing I need to consult the docs more thoroughly.