mirror of
https://github.com/byReqz/probehost2.git
synced 2024-12-25 04:21:47 +00:00
add caddy config example
This commit is contained in:
parent
ce95696ef0
commit
a94503ba7a
29
caddy/Caddyfile
Normal file
29
caddy/Caddyfile
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
email [your email]
|
||||
order rate_limit before basicauth
|
||||
}
|
||||
|
||||
:80, :443 {
|
||||
redir * https://[your domain]
|
||||
}
|
||||
|
||||
[your domain] {
|
||||
reverse_proxy [host]:[port]
|
||||
log {
|
||||
output file [path] {
|
||||
roll_size 10GiB
|
||||
roll_keep 10
|
||||
}
|
||||
level INFO
|
||||
}
|
||||
handle_errors {
|
||||
respond "{http.error.status_code} {http.error.status_text}"
|
||||
}
|
||||
rate_limit {
|
||||
zone dynamic {
|
||||
key {remote_host}
|
||||
events 2
|
||||
window 5s
|
||||
}
|
||||
}
|
||||
}
|
8
caddy/Dockerfile
Normal file
8
caddy/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
||||
FROM caddy:builder AS builder
|
||||
|
||||
RUN xcaddy build \
|
||||
--with github.com/mholt/caddy-ratelimit \
|
||||
--with github.com/caddy-dns/cloudflare
|
||||
FROM caddy:latest
|
||||
|
||||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
5
caddy/README.md
Normal file
5
caddy/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# caddy
|
||||
|
||||
This folder contains a sample configuration for caddy with ratelimiting enabled. this will allow 2 requests per IP every 5 seconds. For more on that, check here: https://github.com/mholt/caddy-ratelimit
|
||||
|
||||
I have also included a dockerfile to build caddy with the ratelimiting module.
|
1
caddy/build.sh
Executable file
1
caddy/build.sh
Executable file
@ -0,0 +1 @@
|
||||
xcaddy build --with github.com/mholt/caddy-ratelimit
|
Loading…
Reference in New Issue
Block a user