Files
2022-06-16 18:06:32 -07:00

22 lines
744 B
Caddyfile

# Serves Sourcegraph over HTTPS, using a custom SSL certificate/key pair
# that's bind mounted from the host to /sourcegraph.pem and /sourcegraph.key.
#
# Caddyfile documentation: https://caddyserver.com/docs/caddyfile
{$SRC_SITE_ADDRESS}
# Redirects all HTTP traffic to HTTPS (using custom SSL certificates disables the automatic HTTPS feature of Caddy, see https://caddyserver.com/docs/automatic-https)
@http {
protocol http
}
redir @http https://{host}{uri}
tls /sourcegraph.pem /sourcegraph.key
# Add the reverse proxies IPs (or IP CIDR ranges) to the trusted_proxies list.
# More information in https://caddyserver.com/docs/caddyfile/directives/reverse_proxy
reverse_proxy {
to {$SRC_FRONTEND_ADDRESSES}
trusted_proxies 0.0.0.0/0
}