mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
NEW distro friendly setup-ngxblocker
Includes now inserted into better position in nginx.conf. This now stops the includes being inserted outside of the http{} block in nginx.conf. The include code block is now formatted better to suit most distribution styles of commenting in nginx.conf. REF: #256 REF: #266
This commit is contained in:
parent
0811fcb955
commit
2d559b3842
1 changed files with 3 additions and 2 deletions
|
@ -206,7 +206,7 @@ add_includes() {
|
|||
|
||||
#add comment above inserts
|
||||
text="include $conf_dir/$(echo $include_list | awk '{print $NF}');"
|
||||
sed -i "s|$text|\n\n# Nginx Bad Bot Blocker Includes\n# REPO: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker\n\t$text|" $file
|
||||
sed -i "s|$text|\n\n ##\n # Nginx Bad Bot Blocker Includes\n # REPO: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker\n ##\n\t$text|" $file
|
||||
|
||||
# remove placeholders
|
||||
sed -i "s|$ph||g" $file
|
||||
|
@ -426,7 +426,8 @@ main() {
|
|||
col_size=$(( $(longest_str $CONF_FILES) + $(echo $CONF_DIR | wc -m) + 10 ))
|
||||
|
||||
# update main config
|
||||
line=$(find_includes $MAIN_CONF include last http first '\}' last )
|
||||
#line=$(find_includes $MAIN_CONF include last http first '\}' last )
|
||||
line=$(find_includes $MAIN_CONF sendfile last http first '\}' last )
|
||||
if [ -n "$(check_wildcard $MAIN_CONF $CONF_DIR)" ]; then # also recalculate column width
|
||||
col_size=$(( $(longest_str $VHOST_INCLUDES) + $(echo $BOTS_DIR | wc -m) + 10 ))
|
||||
printf "%-10s %-${col_size}s %s\n" "INFO:" "$CONF_DIR/* detected" "=> $MAIN_CONF"
|
||||
|
|
Loading…
Add table
Reference in a new issue