Skip to content

Feature/reverse proxy - #2444

Draft
astrowild99 wants to merge 6 commits into
frangoteam:masterfrom
astrowild99:feature/reverse-proxy
Draft

Feature/reverse proxy#2444
astrowild99 wants to merge 6 commits into
frangoteam:masterfrom
astrowild99:feature/reverse-proxy

Conversation

@astrowild99

Copy link
Copy Markdown

📌 Description

Introducing a new ENV variable to deploy FUXA under a custom path (e.g. /fuxa) when working behind a reverse proxy.

The env variable is BASE_PATH and a working example is BASE_PATH=/fuxa.

The change keeps the current working structure, and is a runtime change, meaning that
you don't have to specify the path at compile time.

It has been tested both with docker behind an nginx proxy and on k8s with traefik ingress and
the Gateway API.

A tiny paragraph in the deploy documentation is therefore added, to explain how to work behind a reverse proxy.

A few typo were fixed when working on the routing paths.


🧪 Type of Change

Please mark the relevant option:

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Other

🚫 Build Artifacts Check

Please confirm:

  • I did NOT commit /client/dist
  • I did NOT commit generated Angular build output
  • Only source files are included

🔍 Checklist

  • Code follows project coding standards
  • I tested my changes locally
  • Documentation updated if required
  • Issue opened (for major changes)

📚 Documentation Checklist (if applicable)

  • The documentation builds locally with mkdocs serve
  • All links were tested
  • Images use relative paths (e.g. images/example.png)
  • No references to the old GitHub Wiki
  • Navigation updated in mkdocs.yml (if required)

📝 Additional Notes

@unocelli

Copy link
Copy Markdown
Member

Hi @astrowild99 Thanks for working on reverse-proxy/base-path support. The direction makes sense, but I think you need to fix a few cases before this can be merged.

With BASE_PATH=/fuxa, some paths still look broken:

  • The refresh cookie path is still hardcoded to /api/refresh in server/api/auth/index.js. Since the endpoint becomes /fuxa/api/refresh, the browser will not send the cookie and enableRefreshCookieAuth will break under a base path. Please update both setRefreshCookie() and clearRefreshCookie() to use the normalized base path.

  • Snapshot image URLs are still generated as root-relative /snapshots... in client/src/app/gauges/controls/html-image/html-image.component.ts, while the server now mounts them at BASE_PATH + '/snapshots'. Please build these URLs through the same base-path logic used by API/socket URLs.

  • getListenPath() currently prepends an extra / to BASE_PATH, so BASE_PATH=/fuxa logs //fuxa/.

  • Rewriting index.html, JS and CSS files inside settings.httpStatic at startup is risky. It can fail on read-only deployments, and it also mutates the built assets permanently: starting once with /fuxa can leave the bundle rewritten even after restarting without BASE_PATH.

Please address these before merge, ideally with a manual/tested scenario for BASE_PATH=/fuxa covering API calls, socket connection, refresh-cookie auth, and snapshot images.

@astrowild99

Copy link
Copy Markdown
Author

Thank you for assistance! I will Address these issues within this week and submit an upgrade to this merge request.

@astrowild99
astrowild99 marked this pull request as draft July 27, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants