Caddy and tailscale assistance

1. Output of caddy version:

caddy version → (devel)
installed on alpine with pkgs:
caddy-2.5.2-r4 x86_64 {caddy} (Apache-2.0) [installed]
caddy-openrc-2.5.2-r4 x86_64 {caddy} (Apache-2.0) [installed]

tailscale version:

  tailscale commit: AlpineLinux
  go version: go1.18.7```


## 2. How I run Caddy:
<!-- Please provide all of the relevant information and **DO NOT REDACT** anything except credentials. This is a rule. We cannot help you otherwise! Your exact domain names (etc.) are significant. Thank you! -->
caddy run

using this Caddyfile:

alpine-agt1.tail4ecf6.ts.net

root * /var/www
file_server
log```

a. System environment:

os: Alpine Linux 3.16
OpenRC for caddy service

b. Command:

Paste command here.

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane. -->

d. My complete Caddy config:

Paste your config here, replacing this text.
Use `caddy fmt` to make it readable.
DO NOT REDACT anything except credentials.
LEAVE DOMAIN NAMES INTACT.
Make sure the backticks stay on their own lines.

3. The problem I’m having:

pull the cert created by 'tailscale cert' for use by caddy, no ??? HTTPS Certs
has been enabled in tailscale.```

``It's always giving a 404 error and telling me its using a self-signed cert , cert
shows TRAEFIK_DEFAULT_CERT , so i suspect tailscale not providing the relevant certificate issued to alpine-agt1.tail4ecf6.ts.net as provided by 'tailscale cert'```


### 4. Error messages and/or full log output:
<!--
    Please DO NOT REDACT any information except credentials. Leave domain names intact!
    Please DO NOT POST TRUNCATED LOG LINES as systemd is notorious for this.
    Please USE THIS COMMAND TO VIEW LOGS with systemd:
        $ journalctl -u caddy --no-pager | less +G`
    Please DO NOT USE WEB BROWSERS. Use `curl -v` instead.
    Please ENABLE DEBUG MODE FIRST by adding "debug" to the global options of your Caddyfile.
-->

Don;t seem to be getting the log syntax correct , don’t see relevant logs anywhere

5. What I already tried:

6. Links to relevant resources:

Your post’s formatting is broken. Please fix it!

Hint: backticks for code blocks ``` need to be on their own line.

That’s an outdated version. Latest is v2.6.2. You might need to upgrade to the latest version of Alpine to get it.

I updated Alpine to 3.17 which updated caddy to 2.6.2 , my issue is basically
using this Caddyfile

alpine-agt1.tail4ecf6.ts.net {
  log
  root * /var/www
  templates
  file_server
}

when i goto https://alpine-agt1.tail4ecf6.ts.net in a browser i get a 404 error
and the certificate is from TRAEFIK_DEFAULT_CERT. (self-signed cert , from caddy ??)

but when i use this Caddyfile

alpine-agt1.tail4ecf6.ts.net:1443 {
  log
  root * /var/www
  templates
  file_server
}

everything works, i get the correct certificate ( the one created by doing ‘tailscale cert’ on that machine, i’m running caddy as “root”.

any idea why ???

If you’re seeing Traefik, it’s not Caddy.

Are you sure port 443 is forwarded to the correct machine? Sounds like you’re hitting some other server.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.