Skip to content

Instantly share code, notes, and snippets.

@mostafabahri
Last active June 7, 2018 18:36
Show Gist options
  • Save mostafabahri/441c97b62c2c4e519f51f8dab56c57fa to your computer and use it in GitHub Desktop.
Save mostafabahri/441c97b62c2c4e519f51f8dab56c57fa to your computer and use it in GitHub Desktop.
Reverse proxy and rate-limiting Caddy config
0.0.0.0:2015 {
gzip
log /tmp/caddy.log
proxy / localhost:9009 { # backend api
transparent
}
ratelimit * 3 5 second { # 3 req/sec & bursts of 5
whitelist 192.168.1.0/24
/admin
^/admin/static # to ignore static content
}
}
@mostafabahri
Copy link
Author

ratelimit plugin does not come with the default build. docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment