Prevent wrong config files for caddy on container restarts
This commit is contained in:
parent
3eb7386a58
commit
899257791d
@ -18,7 +18,7 @@ fi
|
|||||||
|
|
||||||
# config: https
|
# config: https
|
||||||
if [[ -n "$EXTERNAL_HTTPS_PORT" ]] ; then
|
if [[ -n "$EXTERNAL_HTTPS_PORT" ]] ; then
|
||||||
cat <<EOF >> /etc/caddy/endpoint
|
cat <<EOF > /etc/caddy/endpoint
|
||||||
https://:8001 {
|
https://:8001 {
|
||||||
tls /certs/cert.pem /certs/key.pem
|
tls /certs/cert.pem /certs/key.pem
|
||||||
EOF
|
EOF
|
||||||
@ -33,7 +33,7 @@ fi
|
|||||||
|
|
||||||
# config: https and additionally http -> create redirect-file
|
# config: https and additionally http -> create redirect-file
|
||||||
if [[ -n "$EXTERNAL_HTTP_PORT" ]] && [[ -n "$EXTERNAL_HTTPS_PORT" ]] ; then
|
if [[ -n "$EXTERNAL_HTTP_PORT" ]] && [[ -n "$EXTERNAL_HTTPS_PORT" ]] ; then
|
||||||
cat <<EOF >> /etc/caddy/redirect
|
cat <<EOF > /etc/caddy/redirect
|
||||||
http://:8000 {
|
http://:8000 {
|
||||||
redir https://$INSTANCE_DOMAIN{uri}
|
redir https://$INSTANCE_DOMAIN{uri}
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ fi
|
|||||||
# close
|
# close
|
||||||
# }
|
# }
|
||||||
if [[ ! -z "$ALLOWED_HOSTS" ]]; then
|
if [[ ! -z "$ALLOWED_HOSTS" ]]; then
|
||||||
cat <<EOF >> /etc/caddy/invalid_host
|
cat <<EOF > /etc/caddy/invalid_host
|
||||||
@invalid-host {
|
@invalid-host {
|
||||||
not {
|
not {
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user