mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-24 02:39:21 -07:00
Improve the Caddy example & add an example to block admin
@@ -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`.
|
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.
|
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
|
# Uncomment this in addition with the import admin_redir statement allow access to the admin interface only from local networks
|
||||||
# (admin_redir) {
|
# (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
|
# Uncomment to allow access to the admin interface only from local networks
|
||||||
# import admin_redir
|
# 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
|
# Proxy everything to Rocket
|
||||||
# if located at a sub-path the reverse_proxy line will look like:
|
# if located at a sub-path the reverse_proxy line will look like:
|
||||||
# reverse_proxy /subpath/* <SERVER>:80
|
# reverse_proxy /subpath/* <SERVER>:80
|
||||||
|
|||||||
Reference in New Issue
Block a user