Virtual host configuration by environment

Not applicable

Hello,

Here is my problem: I have an organization with 2 environments, test and prod. Default host are https://myorg-test.apigee.net and https://myorg-prod.apigee.net.
For production I have a virtual host associated to DNS: https://api.mycomp.com.

In another side I have a proxy implementing URI /my-resource.
So call to this resource in test is: https://myorg-test.apigee.net/my-resource and in prod is: https://api.mycomp.com/my-resource.

I would like to deploy my proxy in test and in prod without changing proxy code but I can't because configuration in test is:

 <HTTPProxyConnection>
        <BasePath>/my-resource</BasePath>
        <Properties/>
        <VirtualHost>secure</VirtualHost>
    </HTTPProxyConnection>

And configuration in prod is:

 <HTTPProxyConnection>
        <BasePath>/my-resource</BasePath>
        <Properties/>
        <VirtualHost>https_vhost</VirtualHost>
    </HTTPProxyConnection>

Is there a way to have <VirtualHost> element dynamic (using KVM for example)?

Thanks and best regards,

Jerome

3 4 896
4 REPLIES 4

Not applicable

I guess this can be done using apigee-maven plugin where you can dynamically change the virtual host using config.json.

We can wait for response from someone from Apigee.

@jerome.folli Hi Jerome, I don't believe you can have the Virtual Host dynamic (eg: based on a KVM). You can change the value in the Element during depoy-time using Maven (as @RK4 mentioned).

The flipside of this is that you will have 2 revisions of the same proxy - one deployed to test and another deployed to prod, each with the correctly replaced Virtual Host.

This means that your deployments will have to be done via the Maven plugin only and you will not be able to simply promote your API from test environment to prod via the Management UI.

Thought the above is definitely possible and will work, a cleaner alternative might be to have the same virtual host name created in the test environment as well. i.e. have 'https_vhost' in test environment still pointing to the same 'https://myorg-test.apigee.net'.

You might want to contact support and check if this is possible.

Not applicable

Hi all,

Thanks for your feedback.

@Prashanth: I was thinking about the solution you have described: to make https_vhost pointing on the same 'https://myorg-test.apigee.net' for test organization.

I will contact support to check if it is possible.
I keep you tuned on it.

Thanks,

Jerome


dkumar
New Member

@jerome.folli: I am facing exactly the same issue. Did you get the solution that how to manage multiple virtual host? We also have different virtual hosts for different environments.