Newbie needs very basic help

1. Caddy version (caddy version):

2.3.0

2. How I run Caddy:

# Caddyfile
badenas.uk.to {
  tls myemail@email.at
  import common.conf
  basicauth / user pass
  proxy 192.168.0.69:5555

  proxy /jellyfin 192.168.0.69:8096 {
    transparent
  }

  proxy /portainer 192.168.0.69:9000 {
    transparent
  }
}

quickconnect.to/MYNASQUICKCONNECT {
  import common.conf
  basicauth / admin pass
  proxy / 192.168.0.69:5555 {
    transparent
  }
}

a. System environment:

b. Command:

I run Caddy 2 in a docker container on my Synology NAS (Docker Hub)

c. Service/unit/compose file:

paste full file contents here

d. My complete Caddyfile or JSON config:

# common.conf
gzip
log stdout
errors stdout
header / {
  Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
  X-XSS-Protection "1; mode=block"
  X-Content-Type-Options "nosniff"
  X-Frame-Options "DENY"
  -Server
}

3. The problem I’m having:

As the fresh owner of a Synology NAS, I got a few containers already running in docker:

  • Portainer
  • Jellyfin
  • Jupyter
  • qBittorrentVPN
  • Killing Floor 2 Server

After reading up a little on it, I found that opening ports for each container to be kind of dangerous (exposing my homenetwork to so many open ports). I wanted to somehow make it a little bit safer.
Some might say that a VPN would be much easier and would fit perfectly for my needs, but I’d like to be able to host at least Jellyfin and the KF2 Server for friends.

I found this thread on the caddy.community and copied the Caddyfile and the conf from there, however, I don’t get more than this site when accessing badenas.uk.to:

Whenever I try to access for instance badenas.uk.to/portainer, I get an 404.

4. Error messages and/or full log output:

2021/01/26 10:58:38.142	INFO	using provided configuration	{"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
2021/01/26 10:58:38.143	INFO	admin	admin endpoint started	{"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["localhost:2019", "[::1]:2019", "127.0.0.1:2019"]}
2021/01/26 10:58:38.143	INFO	http	server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server	{"server_name": "srv0", "http_port": 80}
2021/01/26 10:58:38.143	INFO	tls.cache.maintenance	started background certificate maintenance	{"cache": "0xc00025cf50"}
2021/01/26 10:58:38.143	INFO	autosaved config	{"file": "/config/caddy/autosave.json"}
2021/01/26 10:58:38.144	INFO	serving initial configuration
2021/01/26 10:58:38.143	INFO	tls	cleaned up storage units
2021/01/26 11:06:19.851	INFO	shutting down apps then terminating	{"signal": "SIGTERM"}
2021/01/26 11:06:20.351	INFO	tls.cache.maintenance	stopped background certificate maintenance	{"cache": "0xc00025cf50"}
2021/01/26 11:06:20.851	INFO	admin	stopped previous server
2021/01/26 11:06:20.851	INFO	shutdown done	{"signal": "SIGTERM"}

5. What I already tried:

I’ve read the linked post already a few times, but I don’t seem to get my head wraped around what I’m doing wrong.
For me it seems like Caddy is running ok (hence the welcoming page I am shown). However, there seems to be something wrong with my Caddyfile, but I don’t understand what.

Please be patient with me, I’m still at the very beginning of learning an I don’t have much knowledge built up so far.

Thank you in advance!

Your configs don’t look right, they look like Caddy v1 configs. Caddy v2 is a complete rewrite from the ground up, and there’ve been plenty of changes.

To me it just looks like you haven’t configured your Synology stuff to write your config file to the correct location, i.e. /etc/caddy/Caddyfile. You’re running docker containers, right? If so you’ll want to consult the documentation here: Docker

That thread is from 2017, so it’s not quite so useful.

1 Like

Okay, now I feel pretty stupid. Thanks for the hint.

Yes, I’m running docker containers, I set them up through the Synology Docker App. Here’s what my mounts look like:

Changing the Caddyfile mount path to /etc/caddy/Caddyfile makes the container crash.
I’ll check the Docker Hub out and hope not to get too overwhelmed. :smiley:

Thanks for your Reply and Help!

Yeah – in Caddy v2, it’s /data for storage, not /root/.caddy, as the docs on Docker Hub will tell you.

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