fix: fix: strip /staging prefix in Caddyfile before proxying to staging container (#1079)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/nomad-validate Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/edge-subpath Pipeline was successful
ci/woodpecker/pr/nomad-validate Pipeline was successful
ci/woodpecker/pr/secret-scan Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/nomad-validate Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/edge-subpath Pipeline was successful
ci/woodpecker/pr/nomad-validate Pipeline was successful
ci/woodpecker/pr/secret-scan Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
This commit is contained in:
parent
abca547dcc
commit
d17754efab
3 changed files with 9 additions and 0 deletions
|
|
@ -860,6 +860,7 @@ _generate_caddyfile_subpath() {
|
|||
|
||||
# Reverse proxy to staging
|
||||
handle /staging/* {
|
||||
uri strip_prefix /staging
|
||||
reverse_proxy staging:80
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ EOT
|
|||
|
||||
# Reverse proxy to staging — dynamic port via Nomad service discovery
|
||||
handle /staging/* {
|
||||
uri strip_prefix /staging
|
||||
{{ range nomadService "staging" }} reverse_proxy {{ .Address }}:{{ .Port }}
|
||||
{{ end }} }
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,13 @@ check_staging_routing() {
|
|||
tr_fail "Missing Staging handle block (handle /staging/*)"
|
||||
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)
|
||||
if echo "$CADDYFILE" | grep -q "nomadService"; then
|
||||
tr_pass "Staging uses Nomad service discovery"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue