1. My Caddy version (caddy -version
):
v2.0.0-beta10
2. How I run Caddy:
a. System environment:
OS, relevant versions, systemd? docker? etc.
Linux Mint
b. Command:
./caddy run -config ./config.json
c. Service/unit/compose file:
-
d. My complete config.json:
{
"apps": {
"http": {
"servers": {
"srv0": {
"logs": {},
"listen": [
":443",
":80"
],
"routes": [
{
"match": [{"file": {"root": "./files/", "try_files": ["{path}" ,"{path}.html", "{path}index.html"]}}],
"handle": [
{
"handler": "encode"
},
{
"handler": "file_server",
"root": "./files/",
"pass_thru": false
}
]
}
]
}
}
},
"tls": {
"automation": {},
"session_tickets": {}
}
},
"logging": {
"logs":{
"default": {
"writer": {
"output": "stdout"
},
"level": "debug"
}
}
}
}
3. The problem I’m having:
I want to setup verys imple http server for html+js+css webiste. I want to user clean urls like:
/test instead of /test.html and /test_dir/ instad of /test_dir/index.html
With my config I can’t acces /test but all other url works fine.
4. Error messages and/or full log output:
2019/12/06 18:38:05.713 ERROR http.log.access handled request {"request": {"method": "GET", "uri": "/favicon.ico", "proto": "HTTP/1.1", "remote_addr": "127.0.0.1:58296", "host": "0.0.0.0", "headers": {"Accept": ["image/webp,*/*"], "Accept-Language": ["pl,en-US;q=0.7,en;q=0.3"], "Accept-Encoding": ["gzip, deflate"], "Connection": ["keep-alive"], "Pragma": ["no-cache"], "Cache-Control": ["no-cache"], "User-Agent": ["Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0"]}}, "common_log": "127.0.0.1 - - [06/Dec/2019:19:38:05 +0100] \"GET /favicon.ico HTTP/1.1\" 404 0", "latency": 0.000241749, "size": 0, "status": 404, "resp_headers": {"Server": ["Caddy"]}}