Update Caddyfile

This commit is contained in:
Руслан 2023-10-08 23:38:20 +06:00 committed by GitHub
parent d1dc921d73
commit bdc7be3ce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,9 +3,14 @@
acme_dns google_domains {$CADDY_API_KEY} acme_dns google_domains {$CADDY_API_KEY}
} }
fruw.org {
root * /var/caddy/hugo
file_server
}
ok.fruw.org { ok.fruw.org {
@block { @block {
not remote_ip forwarded {$WHITE_LIST} not client_ip {$WHITE_LIST}
} }
handle @block { handle @block {
basicauth { basicauth {
@ -15,33 +20,30 @@ ok.fruw.org {
header_up X-Real-IP {remote_host} header_up X-Real-IP {remote_host}
} }
} }
respond "IP already added! :)" respond "IP bleached! :)"
} }
vault.fruw.org { vault.fruw.org {
handle_path / { handle_path /admin {
@block {
not client_ip {$WHITE_LIST}
}
handle @block {
redir https://ok.fruw.org
}
reverse_proxy localhost:50000 reverse_proxy localhost:50000
} }
handle_path /* { reverse_proxy localhost:50000
@allow {
remote_ip forwarded {$WHITE_LIST}
}
handle @allow {
reverse_proxy localhost:50000
}
respond 403
}
} }
mail.fruw.org { mail.fruw.org {
@allow { @block {
remote_ip forwarded {$WHITE_LIST} not client_ip {$WHITE_LIST}
} }
handle @allow { handle @block {
reverse_proxy localhost:50001 redir https://ok.fruw.org
} }
respond 403 reverse_proxy localhost:50001
} }
matrix.fruw.org, matrix.fruw.org:8448 { matrix.fruw.org, matrix.fruw.org:8448 {
@ -59,14 +61,14 @@ turn.fruw.org {
} }
rclone.fruw.org { rclone.fruw.org {
@allow { @block {
remote_ip forwarded {$WHITE_LIST} not client_ip {$WHITE_LIST}
} }
handle @allow { handle @block {
reverse_proxy 127.0.0.1:53682 redir https://ok.fruw.org
respond "nothing to auth" 404
} }
respond 403 reverse_proxy 127.0.0.1:53682
respond "nothing to auth" 404
} }
cs.fruw.org { cs.fruw.org {
@ -78,7 +80,7 @@ doom.fruw.org {
} }
fs.fruw.org, http://fs.fruw.org { fs.fruw.org, http://fs.fruw.org {
root * /var/caddy root * /var/caddy/fs
file_server browse file_server browse
} }
@ -87,6 +89,6 @@ ip.fruw.org, http://ip.fruw.org {
respond "{{.RemoteIP}}" respond "{{.RemoteIP}}"
} }
fruw.org, *.fruw.org { *.fruw.org {
respond "hello there" respond "hello there"
} }