httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <san...@temme.net>
Subject Re: canonical port
Date Thu, 18 Aug 2005 19:06:28 GMT
Brian,

On Aug 18, 2005, at 11:45 AM, Brian Akins wrote:

> We have servers that listen on a ports other than 80 which our load  
> balancers communicate with.  The client hits port 80 on the load  
> balancer.  I hacked up a quick module to try to emulate the old  
> "Port" config directive so that redirects go to the "canonical" port.
>     It does this by changing r->parsed_uri.port, based on what  
> ap_get_server_port does

I'm in much the same boat. My module substitutes the outside  
listening port in the post_config handler:

static int bn_post_config(apr_pool_t *pconf, apr_pool_t *plog,  
apr_pool_t *ptemp, server_rec *s)
{
     bn_cfg *cfg;
     server_rec *swalk;

     for (swalk = s; swalk; swalk = swalk->next) {
         cfg = BNSrvConfig(swalk);
         if (cfg->enabled) {
             swalk->port = cfg->listenport;
         }
     }
     return OK;
}

This has been lightly tested and is based on ap_get_server_port  
looking in that particular place first. So far no horrible side  
effects have been observed.

Do you do more/different things?

S.

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF


Mime
View raw message