HTTPS Caddy access

Hi,
I am new to coding in general and only doing this as a hobby more or less, I have a PI at home where I am using it to run my Hassio, Media server (Jellyfin), Portainer, OMV and nextcloud.

Wanted to switch everything to HTTPS but since I followed the steps, I lost access to my nextcloud completely but I can access my Hassio, OMV, Jellyfin and Portainer fine. (keeping my mind nextcloud log no errors)

  • Caddy version
v2.4.5 h1:P1mRs6V2cMcagSPn+NWpD+OEYUYLIf6ecOa48cFGeUg=
  • System environment:

Debian running on a Raspberry PI

b. Command:

systemctl start caddy

systemctl status caddy

-. My complete Caddyfile or JSON config:

Domain name biggs-cloud.tk


biggsjellyfin.duckdns.org:443 {
        reverse_proxy localhost:8096
}
biggscloud.duckdns.org:443 {
        reverse_proxy localhost:81
}
biggsomv.duckdns.org:443 {
        reverse_proxy localhost
}
biggsportainer.duckdns.org:443 {
        reverse_proxy localhost:9000
}
biggshassio.duckdns.org:443 {
        reverse_proxy localhost:8123

none of the subdomains above are working - I am either using my domain name or IP Address to access btw

  • Error messages and/or full log output:

When I try to run Caddy and then check status the below appears:

● caddy.service - Caddy
     Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-01-21 17:51:24 -02; 18h ago
       Docs: https://caddyserver.com/docs/
    Process: 13845 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=ex>
   Main PID: 13845 (code=exited, status=1/FAILURE)
        CPU: 131ms

Please upgrade to v2.4.6

You haven’t posted any logs, so it’s impossible to know why Caddy didn’t start up.

See this page in the docs, which explains how to see your logs:

first thanks francislavoie for your response.

Updated Caddy version to v2.4.6.

v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=

Log after running command:

journalctl -u caddy --no-pager | less +G

What I understand from the below port 80 is being used by another service, if that is correct are you aware how to dedicate port 80 for caddy alone.

 on :80: listen tcp :80: bind: address already in use
Jan 18 03:17:52 raspberrypi systemd[1]: Started Caddy.
Jan 18 03:17:52 raspberrypi systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Jan 18 03:17:52 raspberrypi systemd[1]: caddy.service: Failed with result 'exit-code'.
-- Boot 3e63c6057836473e881465f3eed677bd --
Jan 18 06:51:46 biggs-cloud.tk systemd[1]: Starting Caddy...
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: caddy.HomeDir=/var/lib/caddy
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: caddy.Version=v2.4.5 h1:P1mRs6V2cMcagSPn+NWpD+OEYUYLIf6ecOa48cFGeUg=
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: runtime.GOOS=linux
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: runtime.GOARCH=arm
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: runtime.Compiler=gc
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: runtime.NumCPU=4
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: runtime.GOMAXPROCS=4
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: runtime.Version=go1.17
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: os.Getwd=/
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: LANG=C.UTF-8
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: NOTIFY_SOCKET=/run/systemd/notify
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: HOME=/var/lib/caddy
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: LOGNAME=caddy
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: USER=caddy
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: INVOCATION_ID=7d77f1a7b1924919809777948e309629
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: JOURNAL_STREAM=8:18432
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8401392,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8834755,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8842256,"logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8843312,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8864322,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8876467,"logger":"tls","msg":"finished cleaning storage units"}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.8851957,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x34d6690"}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: {"level":"info","ts":1642495925.899863,"logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0x34d6690"}
Jan 18 06:52:05 biggs-cloud.tk caddy[1027]: run: loading initial config: loading new config: http app module: start: tcp: listening on :80: listen tcp :80: bind: address already in use
Jan 18 06:52:05 biggs-cloud.tk systemd[1]: Started Caddy.
Jan 18 06:52:05 biggs-cloud.tk systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Jan 18 06:52:05 biggs-cloud.tk systemd[1]: caddy.service: Failed with result 'exit-code'.
-- Boot e00f79b23086433db1ad4b83e1713a5d --
Jan 21 17:16:59 biggs-cloud.tk systemd[1]: caddy.service: Unit cannot be reloaded because it is inactive.

If you have another program using port 80, you’ll need to either turn it off or reconfigure it to use a different port.

Caddy needs port 80 since it’s the default HTTP port, so that it can solve ACME HTTP challenges (to get you your certificates) and to set up automatic HTTP->HTTPS redirects for you.

1 Like

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