Getting intermittent 500 Errors when using custom domain host alias in the APIs

When we are calling one of our endpoint with our custom domain host alias "api.mydomain.com", we are getting 500 errors, but when we use the apigee host alias myorg-env.apigee.net, it always works.

Also we are unable to trace the calls made to custom domain "api.mydomain.com"

0 1 167
1 REPLY 1

After investigating through the Nginx access logs, it was found that there were duplicate virtual host aliases. That is the custom domain host alias "api.mydomain.com" was defined in

a) two virtual hosts of the same org

b) virtual hosts across two orgs

This is an antipattern as documented in Define multiple virtual hosts with same host alias and port number.

If there are duplicate host aliases defined, then the router can get confused and route to any of the orgs. In this case, the trace was enabled in org #1, but the request was actually routed to the same Proxy in org #2. Hence traces could not be captured.

The 500 Errors were caused due to one of the objects being null and possibly there was inconsistency in the Proxy code of org #2.

Solution was to remove the duplicate host aliases.