Question

I am developing a webservice, which offers different services, but currently under different ports. Existing services like GitHub or GitLab also several services, but I am wondering how they can expose them under a single port. Are they looking at the header of request and decide if it is a git client or web browser request and tunnel the request to the corresponding handler?

Are there any keywords or topics in this regard, which could help me to understand how its technically done? Thank you!

Was it helpful?

Solution

Yes, typically this problem is solved by reading HTTP headers and then applying rules to direct the traffic to the appropriate host:port. This is sometimes called "content-switching" and is typically one of the primary functions of a proxy. Nginx and HAProxy are popular tools used for this purpose (although Apache Httpd can do it also). Envoy Proxy is newer tool used for this purpose.

Licensed under: CC-BY-SA with attribution
scroll top