Different virtual hosts for internal api calls and external api calls?

Not applicable

We want a way to distinguish hits to an api proxy from internal and external clients. Can we do it via multiple virtual hosts?

Ex.

apidev.mycompany.com:443 (all external clients hit this)

apidev-internal.mycompany.com:9443 (all internal clients hit this)

Also can the second mapping use https?

0 5 817
5 REPLIES 5

You can create virtual host with comma separated virtual host alias .

POST https://api.enterprise.apigee.com/v1/organizations/myorg/environments/test/virtualhosts
Authorization : Basic ***
Content-Type : application/json

{ 
"hostAliases" : [ "apidev.mycompany.com:443" , "apidev-internal.mycompany.com:9443"], 
"interfaces" : [ ], 
"name" : "secure", 
"port" : "9002"  #your port
"sSLInfo" : 
{ "enabled" : "true" , 
"keyStore" : "myKeystore" , 
"keyAlias" : "myKey"}
}
}

Yes. If you want to have different proxy logic for internal and external API calls, you can create multiple ProxyEndpoints, each with different Virtual Hosts.

If you want to do the same logic, but just identify which VHost is being used, use the context variable "virtualhost.name".

(http://docs.apigee.com/api-services/reference/variables-reference)

@LZ Dev

Yes you can definitely create different VHOST for external and Internal api. Also, all this VHOST can be secure using certs (SSL)

In my project, we have implementation so many Vitual hosts for different purpose like

1) One way SSL VHOST INTRANET

2) Two way SSL Vhost INTRANET

3) One way SSL VHOST EXTRANET

4) Two way SSL VHOST EXTRANET

One more important point, all these VHOST can have different domain name but same certificates using SAN Certs i.e. Cerrtificate Alias name.

Not applicable

Thanks for the replies. How isolated are VHs in a given environment? If one goes down, does it affect other too?

Hi @LZ Dev VH is a logical entity and it's specific to an Environment. Hence I don't know if your comment "If one goes down, does it affect other too?" relevant. Also as a practice, if your question is answered and you then have a new, related question, please post it in a new thread and do not add it to your existing thread.