I think you’re actually looking for reverse_proxy
with the fastcgi
transport if you’re not using PHP.
reverse_proxy unix//var/run/fcgiwrap.socket {
transport fastcgi {
env SCRIPT_FILENAME /usr/share/smokeping/smokeping.cgi
}
}
Also I’d recommend structuring your Caddyfile more like this:
0.0.0.0:8981 {
handle /js/* {
root * /usr/share/smokeping/www/js
}
handle /css/* {
root * /usr/share/smokeping/www/css
}
handle /cache/* {
root * /usr/share/smokeping
}
handle /smokeping/images/* {
root * /usr/share/smokeping/www/images
}
handle {
root * /usr/share/smokeping/www
reverse_proxy unix//var/run/fcgiwrap.socket {
transport fastcgi {
env SCRIPT_FILENAME /usr/share/smokeping/smokeping.cgi
}
}
}
file_server
}