Your problem arises from some links (probably AJAX ones) being generated towards a different domain.
You should check the scripts you download for URLs being built at runtime like
...a="https:"==g.location.protocol?"https://csi.gstatic.com/csi":"http://csi.gstatic.com/csi");return...
(example taken from Google Analytics). Same goes for some jQuery applets.
Also, you should verify that some of the scripts don't make AJAX calls of their own to retrieve further URLs. If they do, you need to check whether you want to proxy those calls as well.
Basically, for each call that gives you a same-origin failure, you need to track whence it came from, and instruct your proxy to recognize and rewrite it.
Or you can try and do the same in Javascript, i.e., inject Javascript code that will rewrite those URLs at runtime. For example you could have an explicit check for, say, CKEditor
// client requested a script and you, the proxy, fetched it in 'script'
if (script contains 'CKEDIT.options') {
determine init call position in script
split the script in two, A and B, before and after the init call
make 'script' equal to a new script made up of B plus C plus A concatenated
where C is the line "CKEDIT.options.url = 'http://mysite/proxy...';\n"
so that, user side, the initialization will happen with your site's address
The script will then propagate that address in lots of places without need
for you to rewrite anything else.
} else {
// script is unmodified
}
... other checks like the above...
... finally:
send 'script' to the client