-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.Caddyfile
62 lines (58 loc) · 1.75 KB
/
example.Caddyfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#Sample Caddyfile to use in front of Kiramoji.
#
#Please note: This is for Caddy v2 only.
#Be sure to select the caddy-cgi module when downloading a binary,
#or use https://github.com/aksdb/caddy-cgi when building via xcaddy.
#
#Global options
{
#In case there's an issue with certificates
#email your@email.com
#Disable the admin endpoint, if not used. Typically for managing configurations.
#admin off
# Use verbose logging, if needed.
#debug
#If you use different ports for HTTP and HTTPS, change them here.
#http_port 8080
#https_port 8443
#Make sure the CGI module is ordered last. Do not change this.
order cgi last
}
#This is your domain for Kiramoji. Change it to your registered domain name.
kiramoji.ga {
#Set compression.
encode zstd gzip
#Change dir to the directory of your Kiramoji installation
root * dir
#Add a file server, so that HTML files are served.
file_server {
#Don't serve Perl files and pass them on to the CGI module.
hide *.pl
pass_thru
}
#Block access to some non-public files and folders
respond /*.dat 404
respond /*.txt 404
respond /config.pl 404
respond /wakautils.pl 404
respond /mode_message/* 404
respond /mode_image/* 404
#Custom regexp matcher to capture the script name
@perlFile {
path_regexp perlScript ^(/.*\.pl)
file {
root .
}
}
#This is the CGI block. Change dir to the directory of your Kiramoji installation
cgi @perlFile dir{re.perlScript.1} {
#This dir subdirective is your CGI working directory.
#Change the second dir to the directory of your Kiramoji installation.
dir dir
#This has the name+arguments, Kiramoji needs this to be passed.
script_name {path}
#The server port Caddy listens on needs to be passed to Kiramoji.
env SERVER_PORT={server_port}
}
#You're done.
}