Title: A Domain proxies everything to one upstream: no path routing for UI and API on one origin · Issue #90 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: A Domain proxies everything to one upstream: no path routing for UI and API on one origin · Issue #90 · cloudfall-dev/cloudfall
X Title: A Domain proxies everything to one upstream: no path routing for UI and API on one origin · Issue #90 · cloudfall-dev/cloudfall
Description: Problem Found while deploying Abecra's staging on 2026-10-19. Abecra serves its web app at / and its API at /api on one hostname, which keeps one TLS certificate and no CORS. domain.schema.json has a single proxy.upstream (address, port)...
Open Graph Description: Problem Found while deploying Abecra's staging on 2026-10-19. Abecra serves its web app at / and its API at /api on one hostname, which keeps one TLS certificate and no CORS. domain.schema.json has...
X Description: Problem Found while deploying Abecra's staging on 2026-10-19. Abecra serves its web app at / and its API at /api on one hostname, which keeps one TLS certificate and no CORS. domain.schema.json...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/issues/90
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"A Domain proxies everything to one upstream: no path routing for UI and API on one origin","articleBody":"## Problem\n\nFound while deploying Abecra's staging on 2026-10-19. Abecra serves its web app at `/` and its API at `/api` on one hostname, which keeps one TLS certificate and no CORS. `domain.schema.json` has a single `proxy.upstream` (`address`, `port`), and `domain-site.conf.j2` renders exactly one `location /` that proxies to it.\n\nSo a static web build and an API cannot share a Domain unless the API serves the static files itself. That is the workaround: the API mounts the web build from an `ABECRA_WEB_DIR` directory with an SPA fallback, which puts static file serving, caching headers and `index.html` fallback in application code that nginx already does better. Two components behind one hostname (an API and a separate frontend server, or an API and a websocket service) are not expressible at all.\n\nA related wrinkle seen at the same time: `proxy.upstream` is optional in the schema but the `cloudfall_nginx_site` role asserts it is defined, so a Domain without it validates and then fails on the server.\n\n## Proposal\n\nOrdered routes on a Domain, each either a proxy or static files from a component's release:\n\n```yaml\nspec:\n routes:\n - path: /api/\n upstream: { address: 127.0.0.1, port: 8310 }\n - path: /\n static:\n component: abecra-staging-api\n directory: web/dist # inside releases/\u003crelease>/, via current\n spaFallback: index.html\n```\n\n- `proxy.upstream` stays as shorthand for a single `path: /` proxy route, so existing Domains validate unchanged\n- Paths are validated: unique, start with `/`, most specific rendered first; `/.well-known/acme-challenge/` stays reserved\n- A `static` route serves `\u003cinstallRoot>/current/\u003cdirectory>`, so it switches and rolls back with the component's release (this pairs with the build-step issue: the frontend build lives in the artifact)\n- `healthCheck` stays per Domain; per-route checks can follow\n- Make `proxy.upstream` (or `routes`) required in the schema, so the role's assertion can never fail on a valid config\n\n## Alternatives\n\n- Two hostnames (`app.` and `api.`): works today, but adds CORS, a second certificate and cookie-domain handling for every product that has a UI\n- A raw `extraConfig` nginx snippet: flexible, but unvalidated config is what the managed vhost exists to avoid\n\n## Acceptance\n\n- A Domain with `/api/` → upstream and `/` → static renders a vhost that passes `nginx -t`, serves `index.html` for an unknown path under `/`, and proxies `/api/health` to the API\n- After `cloudfall rollback` of the component, `/` serves the previous release's files\n- An existing Domain with only `proxy.upstream` renders a byte-identical vhost\n- A Domain with two routes for the same path fails `config validate`\n\nDepends on cloudfall-dev/cloudfall#159\nDepends on cloudfall-dev/cloudfall#162","author":{"url":"https://github.com/apps/shipmill-romamo","@type":"Person","name":"shipmill-romamo"},"datePublished":"2026-10-19T18:01:54Z","url":"https://github.com/cloudfall-dev/cloudfall/issues/90"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2fb5b29f-6237-e187-4ed3-dac77b1287f7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CFD6:FD77C:26ABE03:3277649:6B054EBF |
| html-safe-nonce | d3a9451c4ce094f9a3c596bf9162629db9442cf7d212dfcbcfc5021e77879957 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkQ2OkZENzdDOjI2QUJFMDM6MzI3NzY0OTo2QjA1NEVCRiIsInZpc2l0b3JfaWQiOiI0MzY3ODQ0NTczNDU2OTc3NTk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9159d225fb8a3de23e56a55306bb02a869c3158e6710cae8b07749e69dc055f7 |
| hovercard-subject-tag | issue:5928927042 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cloudfall-dev/cloudfall/90/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d231e1ba92a57a15cb0ce10fba0721e832cffb4b5b3e8e5e7270963c499c8115/cloudfall-dev/cloudfall/issues/90 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d231e1ba92a57a15cb0ce10fba0721e832cffb4b5b3e8e5e7270963c499c8115/cloudfall-dev/cloudfall/issues/90 |
| og:image:alt | Problem Found while deploying Abecra's staging on 2026-10-19. Abecra serves its web app at / and its API at /api on one hostname, which keeps one TLS certificate and no CORS. domain.schema.json has... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shipmill-romamo[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| turbo-cache-control | no-preview |
| go-import | github.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git |
| octolytics-dimension-user_id | 339512759 |
| octolytics-dimension-user_login | cloudfall-dev |
| octolytics-dimension-repository_id | 1360999777 |
| octolytics-dimension-repository_nwo | cloudfall-dev/cloudfall |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1360999777 |
| octolytics-dimension-repository_network_root_nwo | cloudfall-dev/cloudfall |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width