gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Multiple hosts for one GitPod

Open TenCoKaciStromy opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe

We have multitenant web application where every tenant has own subdomain. Every tenant has own customizations.

Currently in development environment domains looks like this:

  • tenant-a.localhost:3000
  • tenant-b.localhost:3000
  • etc ...

Describe the behaviour you'd like

The ability to utilize multiple hosts within one GitPod environment. Or ability to prepend prefix to host. Or resolving any subdomain of exposed host.

Describe alternatives you've considered

I don't know about any other alternatives.

Additional context

TenCoKaciStromy avatar Aug 09 '22 09:08 TenCoKaciStromy

couldn't you use traefik as a reverse proxy to manage this ?

Run traefik as a docker container inside the gitpod workspace

jmls avatar Aug 09 '22 14:08 jmls

couldn't you use traefik as a reverse proxy to manage this ?

Run traefik as a docker container inside the gitpod workspace

I'm not sure, how can it help me with this situation. Can you please more elaborate this approach?

TenCoKaciStromy avatar Aug 09 '22 14:08 TenCoKaciStromy

one thought is to use it to rewrite the url / host

so, you would call localhost/tenant-a and traefix would intercept the request and take the url and rewrite it to remove the domain path and change the host header to "tenant-a.localhost" before sending the request to localhost:3000

jmls avatar Aug 09 '22 15:08 jmls

one thought is to use it to rewrite the url / host

so, you would call localhost/tenant-a and traefix would intercept the request and take the url and rewrite it to remove the domain path and change the host header to "tenant-a.localhost" before sending the request to localhost:3000

The webserver accepts requests and resolves current tenant by host name.

TenCoKaciStromy avatar Aug 09 '22 15:08 TenCoKaciStromy

which is why the "hostname" is set by traefik

I'm sure there are several other options you could try https://doc.traefik.io/traefik/routing/routers/ if you want to try and consider this approach. Just trying to make some suggestions so that you can get things done now instead of waiting for gitpod to add this functionality - if they even do.

jmls avatar Aug 09 '22 15:08 jmls

I learned the docs of traefik and it looks like, it's possible use only for publicly visible services. In our case, we have self-hosted gitpod in our private network.

Still I believe, the serving content from subdomain(s) is widely used practice which will be useful for many other scenarios.

TenCoKaciStromy avatar Aug 15 '22 12:08 TenCoKaciStromy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 26 '22 19:11 stale[bot]