1. The problem I’m having:
Hi, I am using Caddy as file server on example.com and as reverse proxy on several subdomains. Now I want to utilize my ssh tunnel to get to a machine behind a nat (rpi). I run
autossh -M 0 -f -o ConnectTimeout=10 -o ServerAliveInterval=60 -o ServerAliveCountMax=2 -i /home/user/.ssh/key -N -R 8080:rpi:22 rnglr.be
In the nat I can ssh to rpi on the standard port.
With caddy running on example.com I need to run the layer 4 app:
{
"apps": {
"layer4": {
"servers": {
"example": {
"listen": [
"0.0.0.0:8000"
],
"routes": [
{
"match": [
{
"ssh": []
}
],
"handle": [
{
"handler": "proxy",
"upstreams": [
{
"dial": [
"localhost:8080"
]
}
]
}
]
}
]
}
}
}
}
}
So now I want to
ssh -p 8000 example.com
to get to rpi on port 22. But it does not work:
ssh -p 8000 example.com
ssh: connect to host example.com port 8000: Connection refused
Do I have to install the app somehow? I just loaded the Caddyfile I used and converted it to json and added the layer4 part shown above.
2. Error messages and/or full log output:
no entries
3. Caddy version:
h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
4. How I installed and ran Caddy:
official packages
a. System environment:
Linux ubuntu 6.8.0-49-generic #49-Ubuntu SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/Linux