I’m trying to setup a reverse proxy using Caddy (great and easy to configure).
Caddy runs a docker on my unraid machine and I want to redirect traffic to some other docker containers. I want the traffic to be able to connect from both outside and inside LAN. I have a server behind NAT, a dynamic IP, duckdns set up and then my own domain pointed using CNAME. Router had ports 80 and 443 forwarded to the appropriate ports assigned to the Caddy docker.
I set up the Caddyfile this way:
proxy /abc 192.168.1.10:1234
proxy /def 192.168.1.10:5678
proxy /ghi 192.168.1.10:9012
Everything works great from outside my LAN. However from inside my LAN I cannot access my.subdomain/abc or the 2 others. I get redirected to my router setup page instead. If I forward port 1234 to my server, I can access the abc service on my.domain:1234 from both outside and inside LAN. But it seems like the router hijacks all connections from inside the LAN on ports 80 and 443.
I’m looking for 2 possible solutions:
- Setup something on my server (some kind of routing software) to let clients from inside the LAN connect to proper services through Caddy.
- Change the http and https ports from 80/443 to something else, so that I could access my services from inside and outside the LAN using https://my.domain:444/abc. This is a less desirable solution but acceptable.
Of course I could get rid of the crappy DSL modem/router which doesn’t have a bridge mode (supplied by my telecom company) but this would be a final solution to this problem.
Hoping someone can point me in the right direction.