Skip to content

Commit

Permalink
simplified the proxy_pass-able deploys friendly option/setup
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Jan 10, 2025
1 parent 3239786 commit 19603a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV REVERSE_PROXY ""
ENV ON_DEMAND_TLS_ASK ""
ENV ALLOWED_REMOTE_IPS_CONTROL_PLANE ""
ENV ALLOWED_REMOTE_IPS_SERVICES ""
ENV ALLOWED_REMOTE_IPS_HTTP "255.255.255.255"
ENV ALLOWED_REMOTE_IPS_HTTP ""
ENV HOST_UNAME Linux

# replaced at runtime:
Expand Down
4 changes: 3 additions & 1 deletion etc/Caddyfile.ctmpl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ https://{{ $hosty }} {
log
}

{{- if $origin | regexReplaceAll "^https://" "" | regexMatch ":" }}{{- else }}
{{- if ne (env "ALLOWED_REMOTE_IPS_HTTP") "" }}
{{- if $origin | regexReplaceAll "^https://" "" | regexMatch ":" }}{{- else }}
http://{{ $origin | regexReplaceAll "^https://" "" }} {
@redir not remote_ip {{ env "ALLOWED_REMOTE_IPS_HTTP" }}
redir @redir https://{host}{uri} permanent
Expand All @@ -131,6 +132,7 @@ http://{{ $origin | regexReplaceAll "^https://" "" }} {
}
log
}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down

0 comments on commit 19603a0

Please sign in to comment.