mirror of
https://github.com/RustyRaptor/deploy-sourcegraph-docker.git
synced 2026-12-04 08:15:24 -07:00
Co-authored-by: Dax McDonald` <31839142+daxmc99@users.noreply.github.com>
22 lines
744 B
Caddyfile
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
|
|
}
|