Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions etc/Caddyfile.ctmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ http:// {
{{ end }}
log
}

http://{{- . }} {
# open /.well-known/ subdir to public (for automatic TLS)
handle /.well-known/acme-challenge/*
# block anything else
handle {
respond Forbidden 403
}
}
{{ end }}


Expand Down Expand Up @@ -120,16 +111,10 @@ http:// {
{{- if ne (env "ALLOWED_REMOTE_IPS_HTTP") "" }}
{{- if $tag | regexMatch "^https://[^:]+$" }}
http://{{ $tag | regexReplaceAll "^https://" "" }} {
@redir {
not path /.well-known/acme-challenge/*
not remote_ip {{ env "ALLOWED_REMOTE_IPS_HTTP" }}
}
@redir not remote_ip {{ env "ALLOWED_REMOTE_IPS_HTTP" }}
redir @redir https://{host}{uri} permanent

@notAcme {
not path /.well-known/acme-challenge/*
}
reverse_proxy @notAcme {{ range $services }} {{ .Address }}:{{ .Port }} {{ end }} {
reverse_proxy {{ range $services }} {{ .Address }}:{{ .Port }} {{ end }} {
lb_policy ip_hash
trusted_proxies {{ env "TRUSTED_PROXIES" }}
}
Expand Down