[Zope-dev] Re: Problem 1: HTTP and HTTPS (more of a proxypass issue)

Chris Withers chrisw@nipltd.com
Tue, 05 Sep 2000 10:08:44 +0100


Itamar Shtull-Trauring wrote:
>  Problem 1: HTTP and HTTPS (more of a proxypass issue)
> =======================================================
> I want to be able to serve both http and https versions of a site from
> Apache.  Problem is, because of the way proxying works, there is no way for
> Zope to know if it is origially being accessed via http or https.  

There is a patch for apache which removes this problem, IIRC,
stephenh@nipltd.com may be able to help more with that...

> My
> solution? Add a folder in top level of Zope called "ssl".  If we see our
> path as proxied by Apache is /ssl/websites/example, we know we are being
> accessed via SSL.  Because of the magic of acquisition, this works, but it's
> still an ugly hack, 

Why is it an ugly hack? Seems like quite a graceful solution to me...

> and slows things down.  

By how much? And why is this? I didn't the acquisiton caused a loss in
performance :-S

> Here's the SiteAccess rule I
> used:
> 
> if REQUEST['PATH_INFO'][:5] == '/ssl/':
>     REQUEST.setVirtualRoot('/')

What difference does it make if you do REQUEST.setVirtualRoot('/',1)?

>     REQUEST.setServerURL(protocol='https', hostname='www.example.com',
> port='443')

Not sure about that port... IIUC, setServerURL should mean that all the
links on your site contain:
https://www.examples.com:443/
...is that what you want?

cheers,

Chris