Updated caddyfile to use rate limiting and connection limits

This commit is contained in:
2025-02-22 19:36:17 +11:00
parent 21d5452055
commit 9410056dfb

View File

@@ -1,12 +1,58 @@
projectreshoot.com {
reverse_proxy localhost:3000 localhost:3001 localhost:3002 {
health_uri /healthz
fail_duration 30s
}
rate_limit {
zone auth {
match {
method POST
path /login /register
}
key {remote_host}
events 4
window 1m
}
zone client {
key {remote_host}
events 100
window 1m
}
}
reverse_proxy localhost:3000 localhost:3001 localhost:3002 {
transport http {
max_conns_per_host 10
}
health_uri /healthz
fail_duration 30s
}
log {
output file /var/log/caddy/access.log
}
}
staging.projectreshoot.com {
reverse_proxy localhost:3005 localhost:3006 localhost:3007 {
health_uri /healthz
fail_duration 30s
}
rate_limit {
zone auth {
match {
method POST
path /login /register
}
key {remote_host}
events 4
window 1m
}
zone client {
key {remote_host}
events 100
window 1m
}
}
reverse_proxy localhost:3005 localhost:3006 localhost:3007 {
transport http {
max_conns_per_host 10
}
health_uri /healthz
fail_duration 30s
}
log {
output file /var/log/caddy/access-staging.log
}
}