Ipfilter plugin in Caddy v.2

Hi,
To restrict access for some IP addresses there was “http.ipfilter” plugin in Caddy v.1.0.x and worked fine.
Is there similar functionality in Caddy v.2? There’s no plugins, but maybe possible to use this option by existing directives in Caddyfile or with API?

Yep, there’s the remote_ip request matcher which is built-in. With it, you can specify an IP or CIDR and handle requests to those differently.

You could use it along with the respond directive to return a 403 (Forbidden) response for example.

1 Like

Thank you very much, that’s very kind of you :+1: Sorry for such a simple question, newbies in Caddy (like me) need some time to reach it. :slightly_smiling_face: Thank you again

2 Likes

No worries at all! That’s what the forums are for, the best place to ask any usage questions :smile:

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.