Hi @C_Fong, I’m going to try to elaborate a little bit on what was likely to be causing your issues.
In your initial question:
To quote from that document:
To configure multiple sites with a single Caddyfile, you must use curly braces around each one to separate their configurations:
Notably, :8888 doesn’t have a curly braced block, and so you have not used curly braces around each one.
If there was a file called c:\tools\jQuery_exp\index.html (or perhaps index.htm or index.txt), Caddy should have served it if you navigated to http://jQuery.test:8888 in your browser. If the file exists, and it wasn’t served, there’s another issue at play that might need to be investigated.
This is called nesting, and the Caddyfile does not support nesting sites within sites (or directives within directives, for that matter).
Each site must be at the top (left-most) level of the Caddyfile.
@conorlburns picked up the fix for this one somewhat, but to elaborate, you didn’t tell Caddy to serve port 8000; you told Caddy to serve the default HTTP port (by specifying http:// but leaving out a port in the site label).
It looks like, instead, you told Caddy to proxy to localhost on port 8000. That means when you connect to Caddy and request http://jquery.calpet.test, Caddy connects to its own localhost on port 8000 and returns the result to you.
This might come back here…
It looks like you have Caddy proxying to itself. It’s listening on port 8000 and proxying to port 8000. Looking at the configuration offered by @conorlburns, I would expect to see Site is not served on this interface to be the result.
This is a classic case, I think, of overthinking the Caddyfile. Lets get back to basics: What do you want Caddy to do for you, in plain English?