谷姐:我们都是谷歌迷
We are all Google fans

求助,caddy2配合smokeping所有的img和js文件404-drivefuse

Rate this post

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

还是不行 放弃了

未经谷姐允许不得转载:谷姐靓号网 » 求助,caddy2配合smokeping所有的img和js文件404-drivefuse
分享到: 生成海报

热门文章

评论 抢沙发

评论前必须登录!

立即登录   注册

买Google Voice认准【谷姐靓号网】

Google Voice靓号列表Google Voice自助购买
切换注册

登录

忘记密码 ?

切换登录

注册

我们将发送一封验证邮件至你的邮箱, 请正确填写以完成账号注册和激活