Skip to content

Commit ab78b99

Browse files
committed
fix(caddy): wrap coraza_waf inside route block
1 parent 64d29cb commit ab78b99

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

shared/caddy/caddy.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@ func GenerateCaddyfile(appName, domain, outputMode string, port int, appDir stri
5454
X-Permitted-Cross-Domain-Policies "none"
5555
Content-Security-Policy "%s"
5656
}
57-
coraza_waf {
58-
load_owasp_crs
59-
directives "
60-
SecRuleEngine On
61-
SecRequestBodyAccess On
62-
SecAuditLog /var/log/caddy/audit.log
63-
SecAuditLogType Serial
64-
SecDebugLog /var/log/caddy/debug.log
65-
SecDebugLogLevel 3
66-
"
57+
route {
58+
coraza_waf {
59+
load_owasp_crs
60+
directives "
61+
SecRuleEngine On
62+
SecRequestBodyAccess On
63+
SecAuditLog /var/log/caddy/audit.log
64+
SecAuditLogType Serial
65+
SecDebugLog /var/log/caddy/debug.log
66+
SecDebugLogLevel 3
67+
"
68+
}
6769
}`, csp)
6870

6971
sDomain := domain
@@ -93,8 +95,6 @@ func GenerateCaddyfile(appName, domain, outputMode string, port int, appDir stri
9395

9496
sharedStaticDir := filepath.Join(filepath.Dir(appDir), "shared_static")
9597

96-
// log must come before the catch-all `handle` block; placing it after
97-
// causes Caddy to misparse it as a new site address (line-order matters).
9898
return fmt.Sprintf(`%s {%s
9999
log {
100100
output file /var/log/caddy/access.log

shared/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ package shared
33
// Version is set at build time via -ldflags.
44
// Use a variable (not a constant) so the value can be overridden by -ldflags.
55
// Default to "dev" for local or non-release builds.
6-
var Version = "v0.7.8"
6+
var Version = "v0.7.9"

0 commit comments

Comments
 (0)