Private cloud Virtual host issue

Hi guys, I have setup Apigee 4.17.05 and used this config settings for Onboard an organization,

IP1=10.0.10.1

# Specify the IP or DNS name of the Management Server.
MSIP="$IP1"

# Specify the Edge admin credentials.
ADMIN_EMAIL="admin@abc.com"
APIGEE_ADMINPW=Secret1235345     # If omitted, you are prompted for it.

# Specify organization name and administrator.
ORG_NAME=hcltech  # lowercase only, no spaces, underscores, or periods.

# Set the organization administrator.
# Do not use sys admin as organization administrator.
#
# Create a new user for the organization administrator. 
NEW_USER="y"
# New user information if NEW_USER="y".
USER_NAME=org_admin@abc.com
FIRST_NAME=org
LAST_NAME=admin
USER_PWD="Secret123456"
ORG_ADMIN=org_admin@abc.com

# Specify an existing user as the organization admin,
# omit USER_NAME, FIRST_NAME, LAST_NAME, USER_PWD.
# NEW_USER="n"
# ORG_ADMIN=existing@user.com
# Specify environment name. 
ENV_NAME=prod

# Specify virtual host information.
VHOST_PORT=9001
VHOST_NAME=default

# If you have a DNS entry for the virtual host.
VHOST_ALIAS="$IP1:9001"

# If you do not have a DNS entry for the virtual host, 
# specify the IP and port of each router as a space-separated list:
# VHOST_ALIAS="firstRouterIP:9001 secondRouterIP:9001" 

# Optionally set the base URL displayed by the Edge UI for an
# API proxy deployed to the virtual host.
# VHOST_BASEURL="http://myCo.com"

# Optionally configure TLS/SSL for virtual host.
# VHOST_SSL=y     # Set to "y" to enable TLS/SSL on the virtual host.
# KEYSTORE_JAR=   # JAR file containing the cert and private key.
# KEYSTORE_NAME=  # Name of the keystore. 
# KEYSTORE_ALIAS= # The key alias.
# KEY_PASSWORD=   # The key password, if it has one. 

# Specify the analytics group. 
# AXGROUP=axgroup-001 # Default name is axgroup-001.

So now the VHOST_ALIAS = 10.0.10.1:9001

Internally we are reverse-proxying 10.0.10.1:9001 to xxx.yyy.com(public url which worked in earlier apigee installs)

Now for testing I have created an proxy(/test) and deployed it,

curl -v http://10.0.10.1:9001/test works locally

http://xxx.yyy.com/test does not work.

{"fault":
{"faultstring":"Unable to identify proxy for host: xxx.yyy.com:9001 and url: \/test","detail":{"errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"}}}

What changes should I make in config settings?

Solved Solved
0 8 554
1 ACCEPTED SOLUTION

Hi @Maudrit & @rajeshmishra, I did a clean install with host header option and now everything works fine.

I do not understand why the update calls are not solving the issue, I did clean install twice to solve two different issues while setting up AIO.

Thanks for the info and help.

View solution in original post

8 REPLIES 8

Create your virtual host alias with the the public IP address . If you have already run the provisioning script use curl to update the virtual hosts.

curl -X POST -H 'Content-Type: application/json' -u <<sysadmincreds>> http://<msip>/v1/organizations/{org_name}/environments/{env_name}/virtualhosts/{virtualhost_name} -d '{"name": "{virtualhost_name}","hostAliases": ["publicIP1:{vhost_port}" ],"port": "{vhost_port}","interfaces" : []}'

Additionally you have put any Load Balancer in front of router than you can use BaseUrl

so it can be like :

curl -X POST -H 'Content-Type: application/json' -u <<sysadmincreds>> http://<msip>/v1/organizations/{org_name}/environments/{env_name}/virtualhosts/{virtualhost_name} -d '{"name": "{virtualhost_name}","baseUrl" : "http://www.xyz.com","hostAliases": ["www.xyz.com:{vhost_port}" ],"port": "{vhost_port}","interfaces" : []}'

I have tried it, but it did not work.

Please do these 2 things :

1. Undeploy and redeploy the proxy after making the virtual host changes.

2. please look at files at /opt/nginx/conf.d . Is there any bad files. Please also check the contents of file with hcltech~prod. You can also try removing all files under /opt/nginx/conf.d and restart edge-router service.

3. What do you see in UI (API proxy Overview section) of your deployed proxy. Does it reflect the changes ?

Not applicable

@Barahalikar Siddharth the problem may be associated to how and from where you are calling the virtual host. Since there is no DNS associated to the virtual host, you may need to add the host header to your curl.

See examples on official docs:

http://docs.apigee.com/private-cloud/latest/setting-virtual-host

I have tried the host header option, but unfortunately it did not work. I still get the same error.

Do you have any more ideas @Maudrit?

Execute the following API and share the output:

curl -v -u <adminEmail>:<adminPassword>
http://<management-server>:8080/v1/o/<org-name>/e/<env-name>/virtualhosts

Hi @Maudrit & @rajeshmishra, I did a clean install with host header option and now everything works fine.

I do not understand why the update calls are not solving the issue, I did clean install twice to solve two different issues while setting up AIO.

Thanks for the info and help.

@Barahalikar Siddharth thank you for the sharing.