Apache proxy for crossdomain problems
Well, the Flash player requires a crossdomain.xml file to reside on every server you call for remote services.
We needed to display RSS feeds for user’s blogs and we couldn’t enforce every single blog provider to have a crossdomain file. The solution was to use a local proxy to perform requests on our behalf.
Common solutions use a server side script to fetch the contents but I didn’t want to have yet another PHP, JAVA, Ruby, etc script laying around so I used Apache’s mod_rewrite with a very simple rule:
RewriteEngine On
RewriteRule ^/my_rss_proxy/(.*) $1 [P]
Since we were already using Apache’s proxies to forward request to my HAProxy I just added this simple rule and now we can use:
http://my_server_url/my_rss_proxy/http://rss_url

Comments(3)

















































[...] was another problem. Cross-Domain is always difficult, but we worked around it with a proxy so every blog Rss would be presented on the team [...]
Nice blog, i have added it to my favourites, greetings
I find this blog very interesting, i will be here everyday till now. Greetings