fix: clear auto-detected port maps when re-enabling vhost

Re-enabling vhost on an app that was previously deployed with no global VHOST left the auto-assigned random high port behind in the ports plugin's `map-detected` property, so nginx kept listening on that port and the new catch-all default vhost rejected requests for the app's own domain on port 80.
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-27 15:43:33 -04:00
parent af6267f3b5
commit eaaf0e41c2

View File

@@ -24,6 +24,9 @@ trigger-nginx-vhosts-pre-enable-vhost() {
fn-plugin-property-delete "proxy" "$APP" "proxy-ssl-port"
fi
# clear auto-detected port maps so they get recomputed for vhost mode
fn-plugin-property-delete "ports" "$APP" "map-detected"
# clear ports if there is a mapping starting with http:80 or https:443
local PORT_MAPS=$(plugn trigger ports-get "$APP")
for PORT_MAP in $PORT_MAPS; do