1. The problem I’m having:
Hi, I want to use Caddy as a reverse proxy on example.com for my server (localserver) that I run at home behind a always changing ipv6 adress.
As a first try I used
autossh -M 0 -f -o ConnectTimeout=10 -o ServerAliveInterval=60 -o ServerAliveCountMax=2 -i /home/user/.ssh/id_ed25519 -N -R 8888:localserver:8000 example.com
where the localserver was reachable in the internet on example.com:8888. In the next step I want to utilize Caddy to have it reachable on example.com and ssl encrypted. My current Caddyfile is not working as intented. Can someone help?
2. Error messages and/or full log output:
no entries
3. Caddy version:
2.6.2
4. How I installed and ran Caddy:
ubuntu 22.04 verison package sources
a. System environment:
Linux ubuntu 6.8.0-49-generic #49-Ubuntu SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/Linux
b. Command:
sudo caddy run --config /etc/caddy/Caddyfile
c. Error Messages
2024/11/25 09:50:07.353 ERROR http.log.error dial tcp [ipv6-IP]:8888: connect: connection refused {"request": {"remote_ip": "ipv4", "remote_port": "53918", "proto": "HTTP/2.0", "method": "GET", "host": "example.com", "uri": "/", "headers": {"Sec-Fetch-Mode": ["navigate"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], "Accept-Language": ["de,en-US;q=0.7,en;q=0.3"], "Accept-Encoding": ["gzip, deflate, br, zstd"], "Dnt": ["1"], "Cookie": [], "Upgrade-Insecure-Requests": ["1"], "Sec-Fetch-Dest": ["document"], "Sec-Fetch-Site": ["none"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0"], "Priority": ["u=0, i"], "Te": ["trailers"], "Sec-Fetch-User": ["?1"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "example.com"}}, "duration": 0.015068564, "status": 502, "err_id": "1uqd76vsu", "err_trace": "reverseproxy.statusError (reverseproxy.go:1272)"}
2024/11/25 09:50:07.442 ERROR http.log.error dial tcp [ipv6-IP]:8888: connect: connection refused {"request": {"remote_ip": "ipv4", "remote_port": "53918", "proto": "HTTP/2.0", "method": "GET", "host": "example.com", "uri": "/favicon.ico", "headers": {"Sec-Fetch-Dest": ["image"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0"], "Accept": ["image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5"], "Referer": ["https://example.com/"], "Cookie": [], "Sec-Fetch-Mode": ["no-cors"], "Sec-Fetch-Site": ["same-origin"], "Priority": ["u=6"], "Te": ["trailers"], "Accept-Language": ["de,en-US;q=0.7,en;q=0.3"], "Accept-Encoding": ["gzip, deflate, br, zstd"], "Dnt": ["1"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "example.com"}}, "duration": 0.000841018, "status": 502, "err_id": "du61zvrt2", "err_trace": "reverseproxy.statusError (reverseproxy.go:1272)"}
d. My complete Caddy config:
example.com {
reverse_proxy example.com:8888
}