Hello everyone
1. The problem I’m having:
I have a multi-application application that I’ve called “multi workspace.”
Technologies used:
- NextJS for server-side rendering (SSR)
- Symfony/Api platform for the API
- Caddy for the HTTP server
My application can create multiple apps within itself. For those familiar with WordPress, it’s called “multi-site,” and for PrestaShop, it’s “multi-boutique.”
I end up with these URLs:
- mon-application…com/workspace/{id-application]
- mon-application…com/workspace/marketplace
- mon-application…com/workspace/blog
And I’d like to have subdomains or external domains that map to:
- blog.mon-application…com = mon-application…com/workspace/blog
- Or an externally purchased URL from another site pointing to my multi workspace, e.g., marketplace.com = mon-application.com/workspace/marketplace
I’m wondering what technology is used to achieve this. Can it be resolved with a Reverse Proxy using Caddy Server or Nginx?
Can I use another technology like Traefik?
I feel like this might involve Reverse Proxy Streaming, but I’m just a simple FullStack developer and have gaps in DevOps.
Does anyone have an idea of how to do this?
2. Error messages and/or full log output:
This is my current configuration. This configuration no run
http://portfolio.workspace.local
{
reverse_proxy http://{$PWA_UPSTREAM} {
header_up Host {http.reverse_proxy.upstream.hostport}
#header_up X-Forwarded-Host {host}
header_up X-Real-IP {remote_host}
#header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Port {server_port}
# header_up X-Forwarded-Proto {scheme}
}
handle_path /workspace/portfolio* {
#uri strip_prefix /workspace/portfolio
reverse_proxy {$PWA_UPSTREAM}
}
handle {
uri strip_prefix /workspace/portfolio
reverse_proxy {$PWA_UPSTREAM}/workspace/portfolio
}
}
3. Caddy version:
I use CADDY 2.7 version