Re: [squid-users] Reverse-proxy for site on Google AppEngine

From: Will <vocalster.app_at_gmail.com>
Date: Fri, 1 Jun 2012 14:50:22 -0700

Hi Eliezer,

Thanks for the excellent explanation.

I changed the conf as you suggested, now for all static pages it works
great, the address bar shows my.public.domain.com/page1. However, for
any pages requiring login, it redirects to 'mysite.appspot.com', the
address bar shows mysite.appspot.com/pagelogin, instead of
my.public.domain.com/pagelogin which is what I want.

One main reason I want to use Squid as a reverse proxy is sites on
Google AppEngine is blocked in China by Great Firewall. People in
mainland China cannot access anysite.appspot.com directly. Therefore,
if squid redirects to mysite.appspot.com, it defeats my main purpose.

Any ideas?

Thanks in advance.

Will

--------------------
P.S.

My current squid.conf looks like, (I'm using 3.1 so no 'no-vhost')

http_port 80 accel defaultsite=mysite.appspot.com ignore-cc
cache_peer mysite.appspot.com parent 80 0 no-query originserver
login=PASS name=gaeAccel
acl gae dstdomain my.public.domain.name mysite.appspot.com
http_access allow gae
http_access deny all
cache_peer_access gaeAccel allow gae
cache_peer_access gaeAccel deny all

On Fri, Jun 1, 2012 at 1:27 PM, Eliezer Croitoru <eliezer_at_ngtech.co.il> wrote:
>
> On 01/06/2012 01:23, Will wrote:
>>
>> Hi,
>>
>> I'm setting up a squid 3.1 reverse proxy server (accelerator) for my
>> website on Google AppEngine. The squid.conf looks like this,
>>
>> http_port 80 accel defaultsite=my.public.domain.name ignore-cc
>> cache_peer mysite.appspot.com parent 80 0 no-query originserver
>> login=PASS name=gaeAccel
>> acl gae dstdomain my.public.domain.name
>> http_access allow gae
>> http_access deny all
>> cache_peer_access gaeAccel allow gae
>> cache_peer_access gaeAccel deny all
>>
>> Squid redirects me to the Google's search home page.
>>
>> As soon as I changed mysite.appspot.com in cache_peer to anything
>> else, such as www.yahoo.com, it worked. I've tried substituting
>> mysite.appspot.com with different sites on Google AppEngine, all got
>> redirected to Google's search page.
>>
>> Any idea?
>>
>> It's on Ubuntu Server 12.04, Squid 3.1.
>>
>> Thanks in advance,
>>
>> Will
>
>
> hey will
>
> i dont know exactly how the appspot works but it seems that google uses
> virtual domains on the same ip and response only to requests of domains that
> are hosted on appspot.
>
> what you are doing with a cache_peer is throwing the requested domain to
> the ip of the cache_peer.
>
> so the request that google server "mysite.appspot.com" gets is a request
> for "my.public.domain.name" and since google is not hosting it the basic
> rule is to redirect into google.com
>
> to make it work change the http_port the option to
> "defaultsite=mysite.appspot.com" and add "no-vhost"
>
> on the http_access i'm not sure but i think you should add also the
> "mysite.appspot.com" domain to the allowed such as:
>
> acl gae dstdomain my.public.domain.name mysite.appspot.com
>
> it works like a charm!
>
> Eliezer
>
> --
> Eliezer Croitoru
> https://www1.ngtech.co.il
> IT consulting for Nonprofit organizations
> eliezer <at> ngtech.co.il
Received on Fri Jun 01 2012 - 21:50:29 MDT

This archive was generated by hypermail 2.2.0 : Sat Jun 02 2012 - 12:00:02 MDT