flake/hosts/tyo0/Caddyfile

134 lines
2.2 KiB
Text
Raw Normal View History

{
# Disables HTTP/3 for Hysteria
# https://github.com/apernet/hysteria/issues/768
servers :443 {
protocols h1 h2 h2c
}
}
2024-06-21 15:18:05 +08:00
(default) {
encode zstd gzip
handle_path /robots.txt {
file_server * {
root /var/www/robots/robots.txt
}
}
}
www.ny4.dev {
import default
2024-07-29 03:17:58 +08:00
redir https://blog.ny4.dev
}
2024-06-20 13:49:27 +08:00
# get the certificate for hysteria
tyo0.ny4.dev {
import default
2024-07-29 03:17:58 +08:00
redir https://blog.ny4.dev
2024-06-20 13:49:27 +08:00
}
ny4.dev {
import default
# Synapse
header /.well-known/matrix/* Content-Type application/json
header /.well-known/matrix/* Access-Control-Allow-Origin *
handle_path /.well-known/matrix/* {
file_server * {
root /var/www/matrix
}
}
# Mastodon
header /.well-known/webfinger Access-Control-Allow-Origin *
redir /.well-known/webfinger https://mastodon.ny4.dev{uri} permanent
2024-07-31 22:30:35 +08:00
# TODO: Build Hugo blog with Nix
# How do I use hugo modules without using FOD?
route * {
redir https://blog.ny4.dev
}
}
searx.ny4.dev {
import default
reverse_proxy localhost:8100
}
pb.ny4.dev {
import default
reverse_proxy localhost:8200
}
uptime.ny4.dev {
import default
reverse_proxy localhost:8300
}
ntfy.ny4.dev {
import default
reverse_proxy unix//run/ntfy-sh/ntfy.sock
}
pixiv.ny4.dev {
import default
basicauth {
Guanran928 $2a$14$aI977hGZCX6H9IiyG7avdOFxXFGtlt7DcIahTkInPhEx9Sfhk7bri
}
reverse_proxy unix//run/pixivfe/pixiv.sock
}
id.ny4.dev {
import default
reverse_proxy localhost:8800
}
element.ny4.dev {
import default
root * @element@
2024-08-14 12:36:12 +08:00
header X-Frame-Options SAMEORIGIN;
header X-Content-Type-Options nosniff;
header X-XSS-Protection "1; mode=block";
header Content-Security-Policy "frame-ancestors 'self'";
file_server
}
2024-07-31 21:34:24 +08:00
cinny.ny4.dev {
2024-07-31 22:30:35 +08:00
import default
2024-08-12 21:23:46 +08:00
@index {
not path /index.html
not path /public/*
not path /assets/*
not path /config.json
not path /manifest.json
not path /pdf.worker.min.js
not path /olm.wasm
path /*
}
root * @cinny@
rewrite /*/olm.wasm /olm.wasm
rewrite @index /index.html
2024-07-31 22:30:35 +08:00
file_server
2024-07-31 21:34:24 +08:00
}
2024-06-10 16:48:35 +08:00
git.ny4.dev {
import default
reverse_proxy unix//run/forgejo/forgejo.sock
}
2024-07-11 23:03:11 +08:00
rss.ny4.dev {
import default
reverse_proxy localhost:9300
}
2024-07-14 02:01:10 +08:00
reddit.ny4.dev {
import default
reverse_proxy localhost:9400
}
2024-08-12 21:23:46 +08:00
vault.ny4.dev {
import default
reverse_proxy localhost:9500
}