1. The problem I’m having:
I am running couchdb on raspberry pi and can be access locally using http://192.168.0.103:5984
I have also setup a cloudflared tunnel using subdomain https://couchdb.example.com
so it works well and can be accessed both externally and internally networks. However I want that if I am inside the network then it shouldn’t goto the cloudflared tunnel and directly goto the server. I have configured my pihole and pointed the https://couchdb.example.com
to goto 192.168.0.103
.
I am also running a caddy instance on docker using the following
services:
caddy:
image: caddy:latest
container_name: customcaddy
volumes:
- /home/pi/data/customcaddy/Caddyfile:/etc/caddy/Caddyfile # Map the Caddyfile from host to container
- /home/pi/data/customcaddy/caddy_data:/data # Persist data files like SSL certificates
- /home/pi/data/customcaddy/caddy_config:/config # Persist configuration data
ports:
- "3135:80" # Map port 80 on the container to port 8080 on the host
- "3136:443" # Map port 443 on the container to port 8443 on the host
restart: unless-stopped
volumes:
caddy_data: # Define the named volume for data persistence
caddy_config: # Define the named volume for configuration persistence
this is how my caddyfile looks like
couchdb.example.com {
reverse_proxy http://192.168.0.103:5984
}
With these settings when I visit couchdb.example.com
I am taken to the apache2 default page.
What am I doing wrong ??