1. Caddy version (caddy version
):
v2.2.0 h1:sMUFqTbVIRlmA8NkFnNt9l7s0e+0gw+7GPIrhty905A=
2. How I run Caddy:
static https site
without automatic_https
a. System environment:
ubuntu server 18.04.5
systemd
not docker
b. Command:
systemctl start caddy
c. Service/unit/compose file:
systemd files came from the installtion ("dpkg -i caddy_2.2.0_linux_amd64.deb
")
I edited it ("/lib/systemd/system/caddy.service
")
mod “--config /etc/caddy/Caddyfile
” to “--config /etc/caddy/config.json
”
d. My complete Caddyfile or JSON config:
{
"apps":{
"http":{
"https_port":443,
"servers":{
"srv0":{
"listen":[
":443"
],
"automatic_https":{
"disable":true
},
"tls_connection_policies":[
{
}
],
"routes":[
{
"match":[
{
"host":[
"*.mydomain.com"
]
}
],
"handle":[
{
"handler":"subroute",
"routes":[
{
"handle":[
{
"handler":"file_server",
"root":"/var/www/html",
"index_names":[
"index.html"
]
}
]
},
{
"match":[
{
"path":[
"/mypath"
]
}
],
"handle":[
{
"handler":"file_server",
"root":"/var/www/html",
"index_names":[
"index.html"
]
}
]
}
]
}
]
}
]
}
}
},
"tls":{
"certificates":{
"load_files":[
{
"certificate":"/myssldir/mycert",
"key":"/myssldir/mykey"
}
]
}
}
}
}
3. The problem I’m having:
try to access
https://mydomain.com/mypath
expect index page ("/var/www/html/index.html
") defined in json
but got error 404
access to “https://mydomain.com/
” is fine, index page showing up
4. Error messages and/or full log output:
got error 404
5. What I already tried:
"path": [ "/mypath" ]
"path": [ "*/mypath" ]
"path": [ "/mypath*" ]
"path": [ "*/mypath*" ]
"path": [ "*mypath*" ]
"path": [ "/some_other_paths" ]