CURRENT PROJECTS
loading
CATEGORIES AND POSTS
loading
overset
DEVELOPMENT LOG FOR JIM PALMER
Posted 03/19/2007 in unix


The scenario is having an externally accessible Apache 2.2.4 server providing a clustered proxy for Flash Remoting. The problem I encountered every time I tried to access http://www.myhost.com/_api/flashservices/gateway/ it would access the appropriate clustered proxy node - but that node would immediately send back a 302:Location Redirect which would resolve to a private-network IP address thus making this NOT work.

In a previous post - I outlined how I was using CFJAX through Apache 2.2.4's new load balancing proxy. The following rewrite rule defines that all http://www.myhost.com/_api/(.*) calls will be directed to our load balanced proxy cluster:
<VirtualHost *>
...
RewriteEngine On
RewriteRule ^/_api/(.*) balancer://api_cluster/$1?remote_addr=%{REMOTE_ADDR} [P,QSA]
...
</VirtualHost>

The cluster nodes are defined in the httpd.conf as follows:
<Proxy balancer://api_cluster>
        BalancerMember http://10.0.0.100:80
        BalancerMember http://10.0.0.101:80
</Proxy>

Each clustered proxy node is running IIS6 with a stock installation of Coldfusion 7.X. In a search against the $CF_ROOT/wwwroot/WEB-INF/gateway-config.xml I though commenting out the {context.root} with the tags. This solved the redirect that was occurring with a simple non-AMF request to the http://www.myhost.com/_api/flashservices/gateway/ but when actually using Flash Remoting with data - it still attempted to do the redirect.

After finding a reference to the global servlet-mapping for /flashservices/gateway as per the $CF_ROOT/wwwroot/WEB-INF/web.xml file: /flashservices/gateway/* helped show the light. In simple searching on the tag - it became very evident that the port in any requested URL becomes VERY important so that a redirect does not occur. It is especially evident in the fact that the end-user accesses the proxy frontend via HTTPS and the proxy balancer accesses the nodes with the request contents via HTTP and the same original headers sent from the client.

To solve this problem - add ":80" or the actual proxy node destination port to the end of the BalancerMember entry in the Apache 2.2.4 httpd.conf.

Works like a charm.
comments
loading
new comment
NAME
EMAIL ME ON UPDATES
EMAIL (hidden)
URL
MESSAGE TAGS ALLOWED: <code> <a> <pre class="code [tab4|tabX|inline|bash]"> <br>
PREVIEW COMMENT
TURING TEST
gravatar