Need to block access for a file from external and enable from internal

1. The problem I’m having:

Currently I have the following in caddyfile
handle /actuator/* {
abort
}
This currently blocks complete access from internal and external. I need to enable this from internal and disable it from external

2. Error messages and/or full log output:

No Error

3. Caddy version:

v2.7.6

4. How I installed and ran Caddy:

install caddy package with apt

a. System environment:

Debian 10

b. Command:

caddy runs as a service

c. Service/unit/compose file:

NA

d. My complete Caddy config:

handle /actuator/* {
                abort
        }

5. Links to relevant resources:

Use the remote_ip matcher:

1 Like

I modified it to below. Actual IP adresses are modified
@actuator {
path /actuator/*
remote_ip 192.0.0.1 192.0.0.2
}

Still not working. How should I add handle for this ?

Do you mean to invert the condition? Then use not remote_ip

I mean, you’re not giving us enough to go on here. What do you mean it’s “not working”? What did you actually try? Post your entire config, not just a tiny snippet. Show your logs. Make a request with curl -v and show what you get.

1 Like

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