But what I really want to do is to set CGI script’s working directory by Caddyfile, like “WorkingDirectory” directive of systemd service file.
Ah, I see.
I think it’s impossible in current version of caddy-cgi.
Unfortunately, yes, it is currently not possible. I will add an optional dir
directive to support this and will report back here when that is complete.