-1

Recently I found that in IIS we can create 2 or more sites with same port number with a different host header.

But I couldn't understand what is the need for this? In which scenarios is this useful?

Please point me in the direction which can help my understanding?

How does this work when machines are associated with load balancer?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291

1 Answers1

0

Not sure if I understood your question completely, but the main reason is to be able to create multiple virtual host in one single physical machine. It would be wasteful if a single machine could host only one application, as it typically wouldn't be able to utilize most of the machine's resources.

It would work the same even with a load balancer. The clients would send an HTTP request to the load balancer on port 80 and the server would redirect the request to a specific VM on port 80, which would then figure out which site/app to serve depending on the host header.

If you were also asking why the port has to be the same (e.g. 80): it doesn't. But since we have this host header functionality to determine which app the client wants to talk to, we can keep using the typical HTTP port (80) for all hosted apps.

Denat Hoxha
  • 915
  • 8
  • 16
  • hi denat, my need for understanding is why can't we deploy other applications on multiple ports, why reuse a single one with additional complexity? – Mahesh Gupta Mar 05 '19 at 08:43