I’m brand new to caddy and have just worked through the beginner tutorial and gotten it to run. I’m now trying to work out the caddyfile.
I have a caddyfile set up with (please forgive the formatting)
localhost:8080
root /home/James/www
The caddyfile is in the www directory and so is a very basic HTML file. I then run caddy directly from the www directory. Then using another computer I type 192.168.1.90:8080 and all I get is a message saying 404 site not served on this interface
The important thing to note is that, to determine which site definition to use, Caddy checks the server name sent by the client (in this case, what you put in the browser URL bar) against the site label (the first line of your Caddyfile). In your example, localhost doesn’t match 192.168.1.90, and nothing is set up for the latter, hence the “site not served” response.
You could change the first line to 192.168.1.90:8080 instead, which will instruct Caddy to respond to requests for that site. You could alternately omit the name entirely, leaving only the port (i.e. :8080), and it will use that site definition to respond to any HTTP request on port 8080, regardless of site name (so localhost:8080 in your URL bar will get a response locally).
The Structure heading of the Caddyfile documentation is pretty useful, as is the Caddyfile tutorial.