Skip to content

Commit d0bdb26

Browse files
committed
Check for the existence of files before executing them via CGI for Caddy2.
1 parent 7e6d446 commit d0bdb26

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

example.Caddyfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ kiramoji.ga {
4242
respond /mode_image/* 404
4343

4444
#Custom regexp matcher to capture the script name
45-
@perlFile path_regexp perlScript ^(/.*\.pl)
45+
@perlFile {
46+
path_regexp perlScript ^(/.*\.pl)
47+
file {
48+
root .
49+
}
50+
}
4651
#This is the CGI block. Change dir to the directory of your Kiramoji installation
4752
cgi @perlFile dir{re.perlScript.1} {
4853
#This dir subdirective is your CGI working directory.
4954
#Change the second dir to the directory of your Kiramoji installation.
5055
dir dir
51-
#This is the name/arguments, Kiramoji needs this passed.
56+
#This has the name+arguments, Kiramoji needs this to be passed.
5257
script_name {path}
5358
#The server port Caddy listens on needs to be passed to Kiramoji.
5459
env SERVER_PORT={server_port}

0 commit comments

Comments
 (0)