Can different virtual hosts in different orgs use the same port number?

In an OPDK install, I have two orgs:

  • org1
  • org2

Each org has two environments:

  • prod
  • test

When I create a virtual host for an environment, it prompts me to use port 9001.

Do I have to use a unique port number for each virtual host in each environment, or can I use the same port number, 9001, for all of them?

Stephen

Solved Solved
0 5 413
2 ACCEPTED SOLUTIONS

Not applicable

Yes you can but there are few things you need to consider based on your setup . The way it works AFAIK is as below

When a call lands on a router , it resolves the classificationtree and checks for the best match and gets the VH and that env details

For example : Vhost on env1 and env2 has same port with out hostalias. If we try to call env1 apiproxy , chances that the classificationtree says that the call should go to env2 apiproxy . Router then gets the env based and then gets all the mps associated with that env.

Router gets the allowed message processor list from the system.properties and checks if that part of retrieved list.

If found sends the request to that MP.

Its better you use hostalias+ same port or different ports to be safe so that you don't need to worry or troubleshoot if something goes wrong .

View solution in original post

You cannot use the same port number if the SSL termination happens on the router at that port. So, if the VH port of one org is handling https communication, then the other org cannot use the same port for handling its https traffic if the SSL termination is happening on the routers.

The reason is because at a time router can open listen to only one HTTPS connection per host on a specific port with the specific certs.

View solution in original post

5 REPLIES 5

Stephen the short answer is no you do not need to use a unique port number for each of the environments. IT really depends on your network setup on how you want to configure the different vhosts. Personally, as a rule of thumb I do not use the same vhost ports for production vs non-production environments.

Not applicable

Yes, you can use the same port number for the environments. The Apigee router is capable to handling the routing correctly

Not applicable

Yes you can but there are few things you need to consider based on your setup . The way it works AFAIK is as below

When a call lands on a router , it resolves the classificationtree and checks for the best match and gets the VH and that env details

For example : Vhost on env1 and env2 has same port with out hostalias. If we try to call env1 apiproxy , chances that the classificationtree says that the call should go to env2 apiproxy . Router then gets the env based and then gets all the mps associated with that env.

Router gets the allowed message processor list from the system.properties and checks if that part of retrieved list.

If found sends the request to that MP.

Its better you use hostalias+ same port or different ports to be safe so that you don't need to worry or troubleshoot if something goes wrong .

You cannot use the same port number if the SSL termination happens on the router at that port. So, if the VH port of one org is handling https communication, then the other org cannot use the same port for handling its https traffic if the SSL termination is happening on the routers.

The reason is because at a time router can open listen to only one HTTPS connection per host on a specific port with the specific certs.

Fantastic point Divya, these are things that save the day during issues.