1. The problem I’m having:
Hi there, I’m trying to make it so one of my websites uses a whitelist to block IPs not on it from successfully connecting to the service I am hosting.
I am on the same local network (but not the same machine) as the server that hosts both the caddy container and the service container that I am trying to add a whitelist to.
When I attempt to connect via the LAN IP i.e. when I connect to my server’s IP on my local network via http, it works just fine.
However when I try to connect via my domain name, I get the “Your address is not whitelisted” message.
I have tried whitelisting both my public IPV4 and my public IPV6, to no avail.
2. Error messages and/or full log output:
It seems like even when I use debug
in my caddyfile, I still don’t get any lines relating to this website. I just get generic setup lines.
3. Caddy version:
4. How I installed and ran Caddy:
Caddy is installed via Docker compose, sharing the same compose file as Authelia.
a. System environment:
Ubuntu Server 24.04.2 LTS (GNU/Linux 6.8.0-59-generic x86_64)
b. Command:
docker compose up -d
c. Service/unit/compose file:
caddy:
image: caddy:latest
restart: unless-stopped
cap_add:
- NET_ADMIN
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./caddy/data:/data
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
d. My complete Caddy config:
test.testy.eu {
@denied not remote_ip 82.65.75.74 82.65.75.74/28 private_ranges 2a01:e0a:244:f670:9969:9124:c45a:8ec
abort @denied
respond "Your address is not whitelisted."
reverse_proxy 192.168.1.171:3000
}
(I have blocks for other subdomains but I don’t think this is relevant - I don’t have any generic blocks that would apply to all rules)