## Summary
Fixes asset URLs including `:8080` suffix when app is behind NPM reverse proxy.
**Root cause:** `View::getBaseUrl()` appended `SERVER_PORT=8080` (backend port) to the hostname.
**Fix:**
- Check `APP_URL` env var first (explicit override for proxied deployments)
- Fall back to `X-Forwarded-Proto`/`X-Forwarded-Port` headers before raw `$_SERVER` vars
Paired with `APP_URL=https://crm-moneyflix.bitreport.pt` in production `.env` on CT241.
Fixes [BIT-24927](/BIT/issues/BIT-24927)
When the app runs behind a reverse proxy (NPM), SERVER_PORT was 8080
(the backend port) causing asset URLs to include :8080 even though
clients access via HTTPS on port 443.
Priority: if APP_URL is set in the environment, use it directly.
Fallback: honour X-Forwarded-Proto and X-Forwarded-Port headers before
falling back to the raw SERVER vars.
Fixes crm-moneyflix.bitreport.pt asset URLs generating :8080 suffix.
Co-Authored-By: Paperclip <[email protected]>
spark
merged commit 872ad2d1c6 into master2026-06-10 19:59:31 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Fixes asset URLs including
:8080suffix when app is behind NPM reverse proxy.Root cause:
View::getBaseUrl()appendedSERVER_PORT=8080(backend port) to the hostname.Fix:
APP_URLenv var first (explicit override for proxied deployments)X-Forwarded-Proto/X-Forwarded-Portheaders before raw$_SERVERvarsPaired with
APP_URL=https://crm-moneyflix.bitreport.ptin production.envon CT241.Fixes BIT-24927