Hello,
I’m trying to execute Perl scripts via CGI and Caddy 2 for certain URLs.
For Caddy 1, the CGI plugin at GitHub - jung-kurt/caddy-cgi: Common Gateway Interface plugin for the Caddy HTTP server used a {match} placeholder that captured what the matcher matched, e.g. when specifying /*.pl, {match} contained /script1.pl, depending on the URL.
I am trying to replicate this via Caddy 2 and the CGI plugin GitHub - aksdb/caddy-cgi: Common Gateway Interface plugin for the Caddy HTTP server, however, I am unable to find an equivalent. {path} would work, but unfortunately the script can specify extra arguments separated by a slash after the script name, which I am unable to trim. To illustrate, I have URLS like:
https://example.com/script1.pl/1234/5678, or https://example.com/script2.pl?query=value
Supposing that the *.pl matcher matches script1.pl, the old CGI directive could look like this:
cgi *.pl /usr/local/cgi-bin{match}
which would execute /usr/local/cgi-bin/script1.pl
Thanks for any help in advance.
Erion