Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want to do this yourself, caddy http server [0] works really well and is incredibly easy to use / setup. They even have an example on their home page that shows this for /api and /blog

[0] https://caddyserver.com/



It works pretty well with nginx too: https://fly.io/articles/delivering-multiple-applications-on-...

It's trickier than it seems, though, because you need to get the right combination of Host/X-Forwarded-Host right for a given hosting service. And you frequently need to rewrite HTML to fix links. Not rocket surgery, but usually I'd rather put my hours into dev and not tweaking a proxy.


Which is why people just use subdomains. Far less hassle, works fine.


Alternatively: https://traefik.io/


This is exactly what I use to run a bunch of different personal services in subfolders on the same hostname. Sadly, though some things don't support running in subfolders.


Use nginx to lie to them so they think they're running at the server root?


Pretty specific use-case, but if you use Rancher for Docker orchestration, the built-in load-balancer service that you can deploy makes this pretty easy.


Everything is easy if you're hosting all your stuff in the same machine. It gets complicated if you're using third party services, PaaS etc.


A single load balance server is hard?

You don't have to host all your stuff on one server at all.


Ok, I misunderstood everything. You are very right.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: