Skip to content

Instantly share code, notes, and snippets.

@morph027
Created May 17, 2020 19:16
Show Gist options
  • Save morph027/b771fb579c36ae550ebb2764581a1d0e to your computer and use it in GitHub Desktop.
Save morph027/b771fb579c36ae550ebb2764581a1d0e to your computer and use it in GitHub Desktop.
caddy2 ip filter
intranet.example.com {
@ipfilter {
not remote_ip 192.168.0.0/16
}
route @ipfilter {
# redirect
redir https://example.com/
# or respond
# respond "Access denied" 403 {
# close
# }
}
reverse_proxy / https://intranet.lan
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment