Hm, both work for me ;)
I don’t know an exact solution but an important thing is that the server variable REMOTE_ADDR is not set correctly when using Squid as the webserver now communicates only with clients (=squid) from localhost (=127.0.0.1). So maybe you don’t allow redirects for requests from localhost?