OS/Architecture: Raspbian Lite / Raspberry Pi Zero Wireless
Entering the command ‘caddy’ loads my localhost test site perfectly, but running it from systemd returns the error “404 Site 192.168.1.32:2015 is not served on this interface” in the browser and the following systemctl status log:
caddy.service - Caddy HTTP2 Web Server
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-09-07 22:31:58 EDT; 2min 27s ago
Docs: https://caddyserver.com/docs
Main PID: 433 (caddy)
CGroup: /system.slice/caddy.service
└─433 /usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile
systemd[1]: Started Caddy HTTP2 Web Server.
caddy[433]: Activating privacy features... done.
caddy[433]: http://localhost:2015
caddy[433]: 2017/09/07 22:31:59 http://localhost:2015
caddy[433]: 2017/09/07 22:34:04 [INFO] 192.168.1.32 - No such site at :2015 (Remote: 192.168.1.16, Referer: )
My /etc/systemd/system/caddy.service file is the following:
It seems that caddy cannot use this port? Or maybe failed to translate localhost to the right IP? (192.168.1.32 is a weird IP for localhost, usually it’s 127.0.0.1. Check your /etc/hosts file)
My guess (as a newbie) is that systemd is working fine and there’s something wrong in your Caddyfile or in your network configuration.
Are you sure you tested it with the same exact configuration you are using in systemd service?