Skip to content

Instantly share code, notes, and snippets.

@xacrimon
Created August 21, 2025 14:33
Show Gist options
  • Save xacrimon/8251ee18db56ee03197fce44f8d07831 to your computer and use it in GitHub Desktop.
Save xacrimon/8251ee18db56ee03197fce44f8d07831 to your computer and use it in GitHub Desktop.
{
log default {
output stdout
format json
include admin.api
}
log access {
output file /data/caddy/log/access.log {
mode 600
roll_size 100MiB
roll_uncompressed
roll_keep_for 720h
}
format json
exclude admin.api
}
metrics {
per_host
}
grace_period 5m
shutdown_delay 0s
email [email protected]
servers {
timeouts {
read_body 1h
read_header 5m
write 1h
idle 2m
}
keepalive_interval 15s
max_header_size 16KiB
log_credentials
enable_full_duplex
}
}
(enable-compression) {
encode {
zstd
gzip
minimum_length 1100
}
}
(normalize-trailing) {
@trailing_slash `!{path}.startsWith("/.within.website/") && path_regexp('normalized_path', '^(.*)/$')`
rewrite @trailing_slash {re.normalized_path.1}
}
(proxy-headers) {
header_up X-Http-Version {http.request.proto}
header_up X-Real-Ip {http.request.remote.host}
header_up X-Tls-Version {http.request.tls.version}
}
(proxy-stream-conf) {
stream_timeout 24h
stream_close_delay 5m
}
(proxy-transport) {
transport http {
read_buffer 4KiB
write_buffer 4KiB
max_response_header 8KiB
dial_timeout 3s
dial_fallback_delay 300ms
response_header_timeout 5m
expect_continue_timeout 5m
read_timeout 5m
write_timeout 5m
keepalive 2m
keepalive_idle_conns_per_host 32
}
}
(httpdebug) {
handle /httpdebug {
reverse_proxy httpdebug:3000 {
import proxy-headers
import proxy-stream-conf
import proxy-transport
}
}
}
(site-cfg-default) {
request_body {
max_size 512KiB
}
import enable-compression
import normalize-trailing
import httpdebug
}
(site-cfg-forgejo) {
request_body {
max_size 512MiB
}
import enable-compression
import normalize-trailing
import httpdebug
}
(anubis-serve) {
@anubis path /.within.website/* /robots.txt /.well-known/robots.txt
handle @anubis {
reverse_proxy anubis:3000 {
import proxy-headers
import proxy-stream-conf
import proxy-transport
}
}
}
(anubis-auth) {
reverse_proxy anubis:3000 {
import proxy-headers
import proxy-stream-conf
import proxy-transport
method GET
rewrite /.within.website/x/cmd/anubis/api/check
@bad status 4xx
handle_response @bad {
redir * /.within.website/?redir={uri} temporary
}
@good status 2xx
handle_response @good {
}
}
}
(site) {
{args[0]} {
import {args[0]}
}
www.{args[0]} {
redir https://{args[0]} temporary
}
}
(acrimon.net) {
import site-cfg-default
respond "acrimon.net"
}
(seaforge.org) {
import site-cfg-forgejo
import anubis-serve
handle /metrics {
respond "unauthorized" 401
}
handle {
import anubis-auth
reverse_proxy forgejo:3000 {
import proxy-headers
import proxy-stream-conf
import proxy-transport
header_down Cache-Control "^(.+, )?no-transform(, .+)?$" "$1$2"
}
}
}
(goobers.lgbt) {
import site-cfg-default
respond "get m0ggd"
}
(ert2.goobers.lgbt) {
import site-cfg-default
reverse_proxy ert:8000 {
import proxy-headers
import proxy-stream-conf
import proxy-transport
}
}
(wand.goobers.lgbt) {
import site-cfg-default
import anubis-serve
handle {
import anubis-auth
reverse_proxy wanderer:8000 {
import proxy-headers
import proxy-stream-conf
import proxy-transport
}
}
}
import site acrimon.net
import site seaforge.org
import site goobers.lgbt
import site ert2.goobers.lgbt
import site wand.goobers.lgbt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment