/ Zope / Apsis / Pound Mailing List / Archive / 2005 / 2005-03 / Re: Backend on standard ports

[ << ] [ >> ]

[ OWA and SSL problem / "Oscar Fowler" ... ] [ ANNOUNCE: Pound - reverse proxy and load balancer ... ]

Re: Backend on standard ports
Robert Segall <roseg(at)apsis.ch>
2005-03-06 17:39:07 [ SNIP ]
On Saturday 12 February 2005 22:46, John Hansen wrote:
> Please accept the below patch as a means of avoiding adding the standard
> port number to the backend request, as this is added to HTTP_HOST, and as
> such, may break some applications.
>
>
> diff -ruN pound-1.8.1-old/svc.c pound-1.8.1/svc.c
> --- pound-1.8.1-old/svc.c     2005-02-09 22:16:30.000000000 +1100
> +++ pound-1.8.1/svc.c         2005-02-13 00:42:21.000000000 +1100
> (at)(at) -666,10 +690,7 (at)(at)
>      if(strchr(host, ':') != NULL)
>          /* the host already contains a port */
>          return NULL;
> -    sprintf(res, "Host: %s:%hd", host, ntohs(to_host->sin_port));
> +    if(ntohs(to_host->sin_port) != 80)
> +       sprintf(res, "Host: %s:%hd", host, ntohs(to_host->sin_port));
> +    else
> +       sprintf(res, "Host: %s", host);
>      return strdup(res);
>  }

Thanks John, but unfortunately it doesn't work quite that way. The problem we 
have is the way some back-ends react to a Host header, namely when they 
generate a redirect. The port number is necessary in order to allow them to 
generate the correct redirect, even when the original request came in via 
HTTPS.

I agree that the port number looks annoying, but it really is the lesser 
evil...
-- 
Robert Segall
Apsis GmbH
Postfach, Uetikon am See, CH-8707
Tel: +41-44-920 4904

MailBoxer