Rodent of Unusual Size wrote:

* When UseCanonicalName is set to OFF, allow ap_get_server_port to check r->connection->local_addr->port before defaulting to server->port or ap_default_port()
server/core.c r1.247
+1: bnicholes, jim
0: nd, jerenkrantz
nd: can the local_addr->port ever be 0?
bnicholes response: I couldn't tell you for sure if local_addr->port
could be 0. But it makes sense that if it were then Apache wouldn't be listening on any port so it wouldn't matter anyway.
nd replies: But if it can't be 0 the alternatives thereafter make no
sense anymore, right?




Any reason why we can't bring back the "Port" option or somehow designate a "canonical" port. In our environment, our load balancers send traffic to some port besides 80, but all redirects should instruct the client to use port 80 (or 443). The port the client connects to (on the load balancer) may not even be in the Apache config. We must also use "UseCanonicalName Off." Problem is that anything that uses ap_get_server_port (like ap_construct_url), currently, will use this "private" port to do redirects. To work around this, I wrote a little mod that, early in the request, changes r->parsed_uri.port to the correct port. This works and should not be affected by the proposed changes, but I'm unsure if it's screwing something else up.

This is a little confusing. Is there a better way to do this?

--
Brian Akins
Senior Systems Engineer
CNN Internet Technologies



Reply via email to