Question

I have a two-node NLB setup where I need to call several web services from client-side via ajax POSTs. If I hit the page at say:

http://clusternode1/ 

no issues.

If I hit it at

http://clusternode2/ 

no issues.

However, if I hit it at

http//clustername/ 

I get the cross-origin exception (as expected).

Is there anyway around this? Any way to reconcile which name the request is being made from to avoid the cross-domain exception?

Many thanks.

Was it helpful?

Solution

Few things off the top of my head; This depends on a couple of factors and there are a few approaches which you might tackle the issue:

(1) depending on your setup, why not just aim at the load balancer (usually this is the way things would be configured with the NAT), then let the loadbalancer do the work?

(2) If the nodes are on different domains you'll have to either look at provisioning for CORS

(3) If you don't have access to mess with headers etc you can look to proxy this but this semi defeats the purpose of load balancing

(4) perhaps setting cname aliases for each node will avert the crossdomain issues?

Hmm sure there's a solution in there somewhere :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top