88 lines
2.2 KiB
Caddyfile
88 lines
2.2 KiB
Caddyfile
|
(webserver) {
|
||
|
root * /home/user/public_html
|
||
|
file_server
|
||
|
encode zstd gzip
|
||
|
|
||
|
@skylink {
|
||
|
path_regexp skylink ^/([a-zA-Z0-9-_]{46}(/.*)?)$
|
||
|
}
|
||
|
|
||
|
@skylink_file {
|
||
|
path_regexp skylink_file ^/file/([a-zA-Z0-9-_]{46}(/.*)?)$
|
||
|
}
|
||
|
|
||
|
@options {
|
||
|
method OPTIONS
|
||
|
}
|
||
|
|
||
|
# OPTIONS headers to allow CORS https://enable-cors.org
|
||
|
handle @options {
|
||
|
header {
|
||
|
Access-Control-Allow-Origin *
|
||
|
Access-Control-Allow-Methods GET,POST,OPTIONS
|
||
|
Access-Control-Allow-Headers DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range
|
||
|
Access-Control-Max-Age 1728000
|
||
|
}
|
||
|
respond 204
|
||
|
}
|
||
|
|
||
|
reverse_proxy /health-check health-check:3100
|
||
|
|
||
|
reverse_proxy /portals nginx:80 {
|
||
|
header_up User-Agent Sia-Agent
|
||
|
header_down Access-Control-Allow-Origin *
|
||
|
}
|
||
|
reverse_proxy /stats nginx:80 {
|
||
|
header_up User-Agent Sia-Agent
|
||
|
header_down Access-Control-Allow-Origin *
|
||
|
}
|
||
|
reverse_proxy /statsdown nginx:80 {
|
||
|
header_up User-Agent Sia-Agent
|
||
|
header_down Access-Control-Allow-Origin *
|
||
|
}
|
||
|
reverse_proxy @skylink nginx:80 {
|
||
|
header_up User-Agent Sia-Agent
|
||
|
header_up Access-Control-Expose-Headers skynet-file-metadata
|
||
|
header_down Access-Control-Allow-Origin *
|
||
|
}
|
||
|
reverse_proxy @skylink_file nginx:80 {
|
||
|
header_up User-Agent Sia-Agent
|
||
|
header_up Access-Control-Expose-Headers skynet-file-metadata
|
||
|
header_down Access-Control-Allow-Origin *
|
||
|
}
|
||
|
reverse_proxy /skynet/skyfile* nginx:80 {
|
||
|
header_up User-Agent Sia-Agent
|
||
|
header_up Authorization "Basic {env.SIA_API_AUTHORIZATION}"
|
||
|
header_down Access-Control-Allow-Origin *
|
||
|
}
|
||
|
}
|
||
|
|
||
|
(custom.domain) {
|
||
|
{$DOMAIN_NAME} {
|
||
|
tls {$EMAIL_ADDRESS}
|
||
|
import webserver
|
||
|
}
|
||
|
}
|
||
|
|
||
|
(siasky.net) {
|
||
|
siasky.net, *.siasky.net {
|
||
|
tls {
|
||
|
dns cloudflare {env.CLOUDFLARE_AUTH_TOKEN}
|
||
|
}
|
||
|
import webserver
|
||
|
}
|
||
|
}
|
||
|
|
||
|
(localhost) {
|
||
|
:443 {
|
||
|
tls internal {
|
||
|
on_demand
|
||
|
}
|
||
|
import webserver
|
||
|
}
|
||
|
}
|
||
|
|
||
|
import localhost
|
||
|
import custom.domain
|
||
|
# import siasky.net
|