On 2/06/2012 9:50 a.m., Will wrote:
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.

The slightly better way is to use "forcedomain=mysite.appspot.com" on the cache_peer line. This will force the domain to be that label only when passed to the specific peer. Inside Squid you can still handle the public name and route pieces of the site around to other servers under the public name as needed.



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?

There is no redirect. What you are doing is URL-rewriting using defaultsite to do the re-write.

You should be doing the login at Squid, and passing the credentials as needed to the peer. (cache_peer option "login=PASS" on 3.1 and older, "login=PASSTHRU" on 3.2+. exact text in both cases)

Amos

Reply via email to