-
Notifications
You must be signed in to change notification settings - Fork 0
/
sodrak.conf
87 lines (71 loc) · 1.73 KB
/
sodrak.conf
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# NOTE: /etc/init/caddy.conf 파일의 맨 밑에, 아래와 같이 클라우드플레어
# 크레덴셜을 지정한 뒤, 파일 액세스 권한을 제한해야한다.
#
# sudo chown root:root /etc/init/caddy.conf && sudo chmod 600 /etc/init/caddy.conf
# cat <<'EOF' | sudo tee -a /etc/init/caddy.conf
# # NOTE: 아래 두 행은 비밀이므로 숨길것
# env CLOUDFLARE_EMAIL=admin@upnl.org
# env CLOUDFLARE_API_KEY=0123456789abcdef0123456789abcdef01234
# EOF
(common) {
# Enable compression
gzip
# Use a wildcard TLS certificate
tls {
dns cloudflare
}
# Strict security headers
header / {
Strict-Transport-Security "max-age=15768000"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
}
}
# Welcome page
sodrak.upnl.org {
import common
root /var/www/greeting/sodrak
}
# user page
*.sodrak.upnl.org {
import common
root /home
rewrite {
to /{label1}/public_html{uri}
}
}
# wiki
wiki.upnl.org {
import common
fastcgi / /var/run/php5-fpm.sock php
root /home/wiki/wiki
internal /data
internal /conf
internal /bin
internal /inc
rewrite /_media {
r (.*)
to /lib/exe/fetch.php?media={1}
}
rewrite {
to {path} {path}/ /doku.php?id={path_escaped}&{query}
}
}
wiki.sodrak.upnl.org {
import common
redir / https://wiki.upnl.org{uri} 307
}
# book
book.sodrak.upnl.org {
import common
fastcgi / /var/run/php5-fpm.sock php
root /home/server/public_html/book
}
# pdns
pdns.sodrak.upnl.org {
import common
fastcgi / /var/run/php5-fpm.sock php
root /home/pdns/public_html/admin
}
# vim: ft=Caddyfile