Skip to content

Commit c8bdbb2

Browse files
feat: proxy /api/* on main domain to API server via rpx pathRewrites
Adds pathRewrites config so training.localhost/api/* routes to the API server on PORT_API, while api.training.localhost continues to work. Closes #1833.
1 parent c0cb0ca commit c8bdbb2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • storage/framework/core/buddy/src/commands

storage/framework/core/buddy/src/commands/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ async function startReverseProxy(options: DevOptions): Promise<void> {
381381
// Use multi-proxy mode so rpx generates a SINGLE cert covering all domains
382382
await startProxies({
383383
proxies: [
384-
{ from: `localhost:${frontendPort}`, to: domain, cleanUrls: false },
384+
{ from: `localhost:${frontendPort}`, to: domain, cleanUrls: false, pathRewrites: [{ from: '/api', to: `localhost:${apiPort}`, stripPrefix: false }] },
385385
{ from: `localhost:${apiPort}`, to: apiDomain, cleanUrls: false },
386386
{ from: `localhost:${docsPort}`, to: docsDomain, cleanUrls: false },
387387
{ from: `localhost:${dashboardPort}`, to: dashboardDomain, cleanUrls: false },

0 commit comments

Comments
 (0)