Merge pull request 'fix: fix: strip /staging prefix in Caddyfile before proxying to staging container (#1079)' (#1081) from fix/issue-1079 into main
This commit is contained in:
commit
398a7398a9
3 changed files with 9 additions and 0 deletions
|
|
@ -860,6 +860,7 @@ _generate_caddyfile_subpath() {
|
||||||
|
|
||||||
# Reverse proxy to staging
|
# Reverse proxy to staging
|
||||||
handle /staging/* {
|
handle /staging/* {
|
||||||
|
uri strip_prefix /staging
|
||||||
reverse_proxy staging:80
|
reverse_proxy staging:80
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ EOT
|
||||||
|
|
||||||
# Reverse proxy to staging — dynamic port via Nomad service discovery
|
# Reverse proxy to staging — dynamic port via Nomad service discovery
|
||||||
handle /staging/* {
|
handle /staging/* {
|
||||||
|
uri strip_prefix /staging
|
||||||
{{ range nomadService "staging" }} reverse_proxy {{ .Address }}:{{ .Port }}
|
{{ range nomadService "staging" }} reverse_proxy {{ .Address }}:{{ .Port }}
|
||||||
{{ end }} }
|
{{ end }} }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,13 @@ check_staging_routing() {
|
||||||
tr_fail "Missing Staging handle block (handle /staging/*)"
|
tr_fail "Missing Staging handle block (handle /staging/*)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for uri strip_prefix /staging directive
|
||||||
|
if echo "$CADDYFILE" | grep -q "uri strip_prefix /staging"; then
|
||||||
|
tr_pass "Staging uri strip_prefix configured (/staging)"
|
||||||
|
else
|
||||||
|
tr_fail "Missing uri strip_prefix /staging for staging"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check for nomadService discovery (dynamic port)
|
# Check for nomadService discovery (dynamic port)
|
||||||
if echo "$CADDYFILE" | grep -q "nomadService"; then
|
if echo "$CADDYFILE" | grep -q "nomadService"; then
|
||||||
tr_pass "Staging uses Nomad service discovery"
|
tr_pass "Staging uses Nomad service discovery"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue