Setting up Caddy (NAS)

1. The problem I’m having:

2. Error messages and/or full log output:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

3. Caddy version:

4. How I installed and ran Caddy:

a. System environment:

b. Command:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

c. Service/unit/compose file:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

d. My complete Caddy config:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

5. Links to relevant resources:

This week I learned about NGINX and CADDY and I liked the way Caddy sounds as far as HTTPS connection and what not. In any case I am having a lot of trouble trying to set this up.

I have caddy installed on my nas which I simply used these command that I found on caddy website

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

In any case this part worked smoothly. I then proceeded to edit the Caddyfiles and here is my Caddyfile

:80 {
        # Set this path to your site's directory.
        root * /usr/share/caddy

        # Enable the static file server.
        file_server

        # Another common task is to set up a reverse proxy:
        # reverse_proxy localhost:8080

        # Or serve a PHP site through php-fpm:
        # php_fastcgi localhost:9000
}
xxx.duckdns.org {
    reverse_proxy ip:port
}

once I ran this command I restarted caddy and I went to xxx.duckdns.org at least I think this is what I am suppose to do but nothing works.

Here is a bit more information as running a curl command as asked for on the website

curl localhost:2019/config/
{"apps":{"http":{"servers":{"srv0":{"listen":[":443"],"routes":[{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"ip:port"}]}]}]}],"match":[{"host":["xxx.duckdns.org"]}],"terminal":true}]},"srv1":{"listen":[":80"],"routes":[{"handle":[{"handler":"vars","root":"/usr/share/caddy"},{"handler":"file_server","hide":["/etc/caddy/Caddyfile"]}]}]}}}}}


My ip address is correct and the ports are well.

I setup my domain with goDaddy and put a CNAME with the

cname photos xxx.duckdns.org.

If anyone can help me please. These tutorial sometimes are hard to follow but I am doing my best trying to figure all this out.

Howdy @Kevin_Suriel, welcome to the Caddy community.

There’s not a lot of information here to troubleshoot. It’s not very clear exactly what steps you got up to and how it failed at that stage. All you wrote is that you restarted Caddy and nothing works, but it’s missing a lot of detail.

What specifically doesn’t work, and what does it look like when it doesn’t work? What errors do you get? You said you restarted Caddy but how did you start it to begin with? What output did Caddy give you when you ran it? You haven’t included the command you used, or any details about your environment other than it’s a NAS (presumably Debian-based). Did you check Caddy’s output - maybe via journalctl? Caddy’s logs are designed to give you useful information to help determine what might be causing issues, or let you post them for others to help dissect.

What we’re looking for with curl is actually your website itself, i.e. your DuckDNS subdomain. Although this tells us that Caddy is running which is good, and that it’s trying to serve your site over HTTPS, which is good. Now we just need to figure out what exactly is going wrong.

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