typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 424 forks source link

Is it possible to proxy multiple hotel servers into one? #259

Open DaxChen opened 6 years ago

DaxChen commented 6 years ago

Hi, first of all, thank you for such a great library! I've been using hotel for several months now, and can't imagine working without it!

I have a website which is consist of two different repos. In production, these two repos are deployed separately but linked together with NGINX.

For example: If the url starts with app, than it is rewritten to one repo: https://example.com/app/ -> repo one and everything else is rewritten to another repo: https://example.com/ -> repo two

This is actually because of the repo one (^/app) is a heavy SPA, and repo two is more of a statically rendered home page website using different framework/stack.

I have been developing these two repos separately: http://repo-one.test/app http://repo-two.test/

But now with hotel, I am thinking if there's a way to rewrite these two repos together, maybe with a proxy module or something? So then if I go to http://repo.test/app the repo-one server will start, and when I navigate to http://repo.test/, the repo-two server will start. I can start a local NGINX server just for this, but isn't that overkill and wastes my laptop's battery? Or is there some extremely lightweight proxy server I can bind to hotel as http://repo.test to make this work?

Any help are greatly appreciated!

Best wishes, Dax