Remove sd-patch and replace with sed -i.

This commit is contained in:
baudneo
2022-10-30 23:30:13 -06:00
parent 361dfe6795
commit 112185c038
2 changed files with 6 additions and 4 deletions

View File

@@ -34,13 +34,13 @@ fi
# Can disable this (default) and add the modsec directives in each location block # Can disable this (default) and add the modsec directives in each location block
if [ "${MODSEC_ENABLE}" == "1" ] || [ "${MODSEC_ENABLE}" -eq 1 ]; then if [ "${MODSEC_ENABLE}" == "1" ] || [ "${MODSEC_ENABLE}" -eq 1 ]; then
log "Enabling modsecurity in server block of port 80 and 443" log "Enabling modsecurity in server block of port 80 and 443"
sed-patch "s|#<MODSEC_ON>|modsecurity on;|g" /etc/nginx/conf.d/default.conf sed -i "s|#<MODSEC_ON>|modsecurity on;|g" /etc/nginx/nginx.conf
sed-patch "s|#<MODSEC_RULES>|modsecurity_rules_file /etc/nginx/modsec/main.conf;|g" /etc/nginx/conf.d/default.conf sed -i "s|#<MODSEC_RULES>|modsecurity_rules_file /etc/nginx/modsec/main.conf;|g" /etc/nginx/nginx.conf
fi fi
# Enabled modsecurity in the server block of :81 (admin dashboard) # Enabled modsecurity in the server block of :81 (admin dashboard)
if [ "${MODSEC_ADMIN_PANEL}" == "1" ] || [ "${MODSEC_ADMIN_PANEL}" -eq 1 ]; then if [ "${MODSEC_ADMIN_PANEL}" == "1" ] || [ "${MODSEC_ADMIN_PANEL}" -eq 1 ]; then
log "Enabling modsecurity in server block of admin dashboard port 81" log "Enabling modsecurity in server block of admin dashboard port 81"
sed-patch "s|#<MODSEC_ON>|modsecurity on;|g" /etc/nginx/conf.d/production.conf sed -i "s|#<MODSEC_ON>|modsecurity on;|g" /etc/nginx/conf.d/production.conf
sed-patch "s|#<MODSEC_RULES>|modsecurity_rules_file /etc/nginx/modsec/main.conf;|g" /etc/nginx/conf.d/production.conf sed -i "s|#<MODSEC_RULES>|modsecurity_rules_file /etc/nginx/modsec/main.conf;|g" /etc/nginx/conf.d/production.conf
fi fi

View File

@@ -56,6 +56,8 @@ http {
map $host $forward_scheme { map $host $forward_scheme {
default http; default http;
} }
#<MODSEC_ON>
#<MODSEC_RULES>
# Real IP Determination # Real IP Determination