Files
sharing/Caddyfile
T

50 lines
873 B
Caddyfile
Raw Normal View History

2025-08-25 16:49:04 -04:00
{
# were behind cloudflare tunnel; terminate tls there
auto_https off
2025-08-25 14:15:52 -04:00
}
2025-08-25 16:49:04 -04:00
:8550 {
# route by host header to each backend
2025-08-25 17:48:21 -04:00
2025-08-25 16:49:04 -04:00
@paste host {env.PASTE_DOMAIN}
handle @paste {
reverse_proxy privatebin:8080
}
@files host {env.FILES_DOMAIN}
handle @files {
reverse_proxy lufi:8081
}
2025-08-25 14:15:52 -04:00
2025-08-25 16:49:04 -04:00
@short host {env.SHORT_DOMAIN}
handle @short {
reverse_proxy shlink:8080
}
2025-08-25 18:07:05 -04:00
# adapter endpoint on the short domain
@shorten {
host {env.SHORT_DOMAIN}
path /shorten
}
2025-08-25 17:48:21 -04:00
handle @shorten {
header {
Access-Control-Allow-Origin https://{env.PASTE_DOMAIN}
Access-Control-Allow-Methods GET, OPTIONS
Access-Control-Allow-Headers *
Cache-Control no-store
}
reverse_proxy shlink-adapter:3000
}
# preflight for /shorten
2025-08-25 18:07:05 -04:00
@shortenPre {
host {env.SHORT_DOMAIN}
method OPTIONS
path /shorten
}
2025-08-25 17:48:21 -04:00
respond @shortenPre 204
2025-08-25 17:00:44 -04:00
respond "unauthorized domain" 404
2025-08-25 16:49:04 -04:00
}
2025-08-25 18:07:05 -04:00