u2b.cx/caddy/Caddyfile
2023-07-22 21:35:03 -07:00

1.1 KiB

{
log http.log.access {
include http.log.access
output stdout
format formatted "[{ts}] {request>remote_ip} {request>headers>X-Forwarded-For} {request>method} {request>host}{request>uri} {status} {request>headers>User-Agent} {request>headers>Referer}" {
time_format "02/Jan/2006:15:04:05-0700"
}
}
log default {
exclude http.log.access
output stderr
format console
}
}
 
:80 {
#nl.u2b.cx u2b.cx {
log
handle_path /proxy/* {
@gv path_regexp gvurl ^\/([a-z0-9-]+\.googlevideo\.com)
handle @gv {
uri strip_prefix /{re.gvurl.1}
reverse_proxy {
to {re.gvurl.1}:443
header_up Host {re.gvurl.1}
header_down Location "^https://(.*)" "/proxy/$1"
transport http {
tls
}
}
}
handle {
respond 403
}
}
handle {
route {
@www path / /favicon.ico
redir @www https://www.u2b.cx{uri} permanent
 
respond /robots.txt "User-agent: *
Disallow: /
"
respond /.* 403
@notget not method GET
respond @notget 403
 
reverse_proxy http://app:8080
}
}
}