Improve the Caddy example & add an example to block admin

William Desportes
2025-06-30 06:18:11 +00:00
parent 8ef61ae35e
commit ebb41ec32e

@@ -17,7 +17,7 @@ Caddy 2 will automatically enable HTTPS in most circumstances, check the [docs](
In the Caddyfile syntax, `{$VAR}` denotes the value of the environment variable `VAR`.
If you prefer, you can also directly specify a value instead of substituting an env var value.
```
```Caddy
# Uncomment this in addition with the import admin_redir statement allow access to the admin interface only from local networks
# (admin_redir) {
@@ -73,6 +73,15 @@ If you prefer, you can also directly specify a value instead of substituting an
# Uncomment to allow access to the admin interface only from local networks
# import admin_redir
# Uncomment to allow access to the admin interface only from the specified forwarded IPs (proxied Cloudflare for example)
# @not_allowed_admin {
# path /admin*
# Trusted IPs one and two
# not remote_ip forwarded xx.xx.xx.xx/32 xx.xx.xx.xx/32
# }
# respond @not_allowed_admin "401 - {http.request.header.Cf-Connecting-Ip} is not an allowed IP." 401
# Proxy everything to Rocket
# if located at a sub-path the reverse_proxy line will look like:
# reverse_proxy /subpath/* <SERVER>:80