On Wed, Aug 09, 2000 at 12:25:32PM +0200, Dr. Dieter Maurer wrote:
> Does anybody know how to convince Apache to pass
> the information from the HTTP HOST header down to ZServer.
> This would be very useful for SiteAccess Access Rules.

HTTP_HOST _is_ passed on to ZServer. I built a generic ProxyPassCleanup
external method for use as a SiteAcces 2 Access Rule that relies on it:

import string

def cleanup(self):
    REQUEST = getattr(self, 'REQUEST', None)
    if not REQUEST: return 'No REQUEST found'
    if not REQUEST.has_key('HTTP_HOST'): return 'No Host found'

    parts = string.split(REQUEST.HTTP_HOST, ':')
    host = parts[0]
    port = (len(parts) > 1 and parts[1]) or 80 # Assume default http port

    REQUEST.setServerURL(hostname=host, port=port)
    return 'Server URL changed to %s:%s' % (host, port)

Just run it as an external method before you assign it as the Access Rule and
it will give you a diagnostic message.

Martijn Pieters
| Software Engineer            mailto:[EMAIL PROTECTED]
| Digital Creations          http://www.digicool.com/
| Creators of Zope               http://www.zope.org/
| ZopeStudio: http://www.zope.org/Products/ZopeStudio

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to