Closed kdevan closed 4 months ago
Ah I see the relevant part here. I need to figure out why it's defaulting to the local client since the request is being made through a tsnet listener. Going to experiment a bit.
Updating with some debugging.
I found that when I log the server
variable the listener shows up:
{
"listen": [
"tailscale/my-node:80"
],
"idle_timeout": 300000000000,
"routes": [
{
"terminal": true
}
],
"automatic_https": {
"disable": true
},
"client_ip_headers": [
"X-Forwarded-For"
],
"protocols": [
"h1",
"h2",
"h3"
]
}
And logging the server.Listeners()
function results in an empty object returns the listener.
[
{
"Listener": {}
}
]
Edit: I see when I add a second listener the server.Listeners()
does return two Listener objects so it is returning the listeners. For now I've installed a local client and with that the fallback is working. Really curious why I can't get the client directly from the tsnet Server though.
I feel like I'm missing something obvious here. I know when I manually install the tailscale client (as opposed to using the caddy-tailscale module) that
/var/run/tailscale/tailscaled.sock
is the correct path. I see when I ssh into the server that the/var/run/tailscale
directory does not exist. But the Caddy logs seem to show the server connecting to the tailscale client. Is there a step I'm missing that I should be doing to set this up correctly?The Tailscale logs when Caddy boots up:
foo.bar.com
has A and AAAA records with private IP values from the Tailscale devicemy-node
. The error after making a request in browser tohttp://foo.bar.com
:Request which shows up in logs right after the error:
Dockerfile:
Caddyfile:
Caddy json config: