1. Caddy version (2.0.0
):
2. How I run Caddy:
I’m running caddy using a caddy file which I modify and run caddy reload.
a. System environment:
CentOS 7
b. Command:
caddy reload
d. My complete Caddyfile or JSON config:
http://adam.teaches.engineering {
handle /files* {
file_server browse {
root /var/www/html/myFiles
}
}
handle * {
root * /var/www/myWebsiteFolder
file_server
reverse_proxy /abc/ws localhost:1025
}
}
3. The problem I’m having:
I’d like to be able to access “http://adam.teaches.engineering” and get the webpage at /var/www/myWebsiteFolder.
But when I access “http://adam.teaches.engineering/files” I want to be able to browse the files at the
/var/www/html/myFiles folder.
I’ve got a websocket connection that goes to http://adam.teaches.engineering/abc/ws that needs to get proxied to locahost:1025 as well.
4. Error messages and/or full log output:
There are no error messages but when I visit http://adam.teaches.engineering/files I just get a 404 page.
When I visit adam.teaches.engineering , the webpage works. The proxy also works.
5. What I’ve tried:
I’m trying to do the simplest thing which is to just serve a webpage at /files rather than *.
http://adam.teaches.engineering {
root /files* /var/www/webPage
file_server
}
But this gives me a 404. It’s as if the path matcher doesn’t work?