1. Caddy version:
v2.4.3 h1:Y1FaV2N4WO3rBqxSYA8UZsZTQdN+PwcoOcAiZTM8C0I=
2. How I run Caddy:
a. System environment:
systemd
, Caddyfile
b. Command:
systemctl start caddy
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
:8888 {
root * /var/www
templates
@listing {
path_regexp ^/(temp/.+|etc)(/.*)?$
}
handle @listing {
file_server * browse
basicauth /etc/secret/* {
user pass
}
}
handle {
respond 403 {
close
}
}
log
}
3. The problem I’m having:
- open caddy-example in browser
- scroll to bottom
- open folder 100
- go back
What should happen?
- Browser should remember scroll position.
- Example (same folder with
lighttpd
): Index of /temp/caddy-example/
What happens?
- Position returns back to top.
4. Error messages and/or full log output:
No error log, just wrong behaviour with default template.
5. What I already tried:
I’ve read through relevant documentation and tried to find file listing template that works properly, but my search skills are failing me.
6. Links to relevant resources:
https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/fileserver/browsetpl.go