Caddy Server

Caddy server is a high performance web server and reverse proxy.

Caddy with Coraza supports autotls (with let´s encrypt), FastCGI, content rendering and reverse proxy.

Installing

Building dependencies

Install golang 1.16 or 1.17.

Caddy with Coraza can be compiled with CGO enabled or disable, if you use CGO_ENABLED=0 you will lose some features and Core Ruleset compatibility, if you enable CGO you will have to install libinjection and libpcre.

Using go install

go install github.com/jptosso/coraza-caddy/caddy@latest

Downloading pre-compiled version from Caddy

Go to https://caddyserver.com/download, select your platform, select Coraza-Waf and select Download.

Using the package installer

Debian/Ubuntu:

Centos/Rhel:

Building from source

git clone https://github.com/jptosso/coraza-caddy
cd coraza-caddy
go get ./...
go build -o caddy caddy/*.go

Building with XCaddy

go install github.com/caddyserver/xcaddy@latest
xcaddy build --with github.com/jptosso/coraza-caddy@latest

Configuration directives

{
    # order coraza first is required, otherwise Coraza won't work
    order coraza_waf first
}

:8080 {
	coraza_waf {
    # you can write directives in Caddyfile
		directives `
			SecAction "id:1,pass,log"
			SecRule REQUEST_URI "/test5" "id:2, deny, log, phase:1"
			SecRule REQUEST_URI "/test6" "id:4, deny, log, phase:3"
		`
    # or include some files with wildcards
    include /coraza/crs/*.conf
	}
	respond "test123"
}

Edit this page on GitHub