infrastructure/configs/Caddyfile
2023-10-09 18:17:28 +06:00

107 lines
2.3 KiB
Caddyfile

{
email im@fruw.org
acme_dns google_domains {$CADDY_API_KEY}
}
fruw.org, fruw.org:8448 {
# hugo
file_server
root * /var/caddy/hugo
handle_errors {
@404-410 expression `{err.status_code} in [404, 410]`
handle @404-410 {
file_server
root * /var/caddy/hugo
rewrite * /404.html
}
}
# matrix
reverse_proxy /_matrix/* localhost:50003
}
ok.fruw.org {
@block {
not client_ip {$WHITE_LIST}
}
handle @block {
basicauth {
{$CADDY_LOGIN} {$CADDY_PASSWORD}
}
reverse_proxy localhost:50009 {
header_up X-Real-IP {remote_host}
}
}
respond "IP bleached! :)"
}
vault.fruw.org {
handle_path /admin {
@block {
not client_ip {$WHITE_LIST}
}
handle @block {
redir https://ok.fruw.org
}
reverse_proxy localhost:50000
}
reverse_proxy localhost:50000
}
mail.fruw.org {
@block {
not client_ip {$WHITE_LIST}
}
handle @block {
redir https://ok.fruw.org
}
reverse_proxy localhost:50001
}
matrix.fruw.org, matrix.fruw.org:8448 {
rewrite / /_matrix/static/
reverse_proxy /_matrix/* localhost:50003
}
git.fruw.org {
rewrite / /fruworg
reverse_proxy localhost:50005
}
turn.fruw.org {
respond "whoa! eturnal server is runnig" 200
}
rclone.fruw.org {
@block {
not client_ip {$WHITE_LIST}
}
handle @block {
redir https://ok.fruw.org
}
reverse_proxy 127.0.0.1:53682
respond "nothing to auth" 404
}
cs.fruw.org {
respond "whoa! cstrike server is runnig" 200
}
doom.fruw.org {
respond "oops! doom2 server is not running" 503
}
fs.fruw.org, http://fs.fruw.org {
root * /var/caddy/fs
file_server browse
}
ip.fruw.org, http://ip.fruw.org {
templates
respond "{{.RemoteIP}}"
}
*.fruw.org {
respond "hello there"
}