caddyfile配置文件是这么写的,搭好后网站能访问,但是进去后所有的js和img和css资源都是404,但是在vps上相关文件夹都有对应的文件。有大神知道怎么改吗
ping.exampe.com {
log {
output file /var/log/caddy.log
}
handle /js/* {
root * /usr/share/smokeping/www/js
}
handle /css/* {
root * /usr/share/smokeping/www/css
}
handle /cache/* {
root * /var/cache/smokeping
}
handle /images/* {
root * /usr/share/smokeping/www/images
}
handle {
root * /usr/share/smokeping/www
reverse_proxy unix//var/run/fcgiwrap.socket {
transport fastcgi {
split ""
env SCRIPT_FILENAME /usr/share/smokeping/smokeping.cgi
}
}
}
file_server
}
热议
2楼 gick
要不是太复杂的还是用caddy v1吧
3楼 iks
docs 不是 www
4楼 drivefuse
在我的机器上路径确实是www
ls -al /usr/share/smokeping/www/
total 20
drwxrwxrwx 4 root root 4096 May 27 17:27 .
drwxrwxrwx 3 root root 4096 May 27 17:27 ..
drwxrwxrwx 2 root root 4096 May 27 17:27 css
lrwxrwxrwx 1 root root 27 Jul 112020 images -> /var/cache/smokeping/images
drwxrwxrwx 2 root root 4096 May 27 18:55 js
-rwxrwxrwx 1 root root 71 Jul 112020 smokeping.fcgi.dist
5楼 iks
这边有个 nginx 配置,你参考参考
https://raw.githubusercontent.com/KukiSa/smokeping/main/nginx.conf
6楼 drivefuse
好的 谢谢
7楼 yjsx86
ping.exampe.com {
log {
output file /var/log/caddy.log
}
handle /js/* {
root * /usr/share/smokeping/www/js
file_server
}
handle /css/* {
root * /usr/share/smokeping/www/css
file_server
}
handle /cache/* {
root * /var/cache/smokeping
}
handle /images/* {
root * /usr/share/smokeping/www/images
file_server
}
handle {
root * /usr/share/smokeping/www
reverse_proxy unix//var/run/fcgiwrap.socket {
transport fastcgi {
split ""
env SCRIPT_FILENAME /usr/share/smokeping/smokeping.cgi
}
}
}
}
8楼 drivefuse
还是不行 放弃了
评论前必须登录!
立即登录 注册