DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=29667>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29667 Proxy detects local URI as remote for vhosts not running on default port Summary: Proxy detects local URI as remote for vhosts not running on default port Product: Apache httpd-1.3 Version: HEAD Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: mod_proxy AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] The proxy_detect functions does not detect local URIs when apache listens on more than the default ports, even when the virtual hosts are setup correctly. Port 80 Listen 8102 ServerName proxy.local <virtualhost _default_:80> ServerAlias proxy ServerAlias 192.168.1.19 </virtualhost> <virtualhost _default_:8102> ServerAlias proxy ServerAlias 192.168.1.19 </virtualhost> When having ProxyRequests Off When requesting /index.php proxy settings to 192.168.1.19:80: REMOTE_ADDR = 192.168.1.32 SERVER_PORT = 80 When requesting /index.php proxy settings to 192.168.1.19:8102: REMOTE_ADDR = 192.168.1.32 SERVER_PORT = 8102 When having ProxyRequests On When requesting /index.php proxy settings to 192.168.1.19:80: REMOTE_ADDR = 192.168.1.32 SERVER_PORT = 80 When requesting /index.php proxy settings to 192.168.1.19:8102: REMOTE_ADDR = 192.168.1.19 SERVER_PORT = 80 And the accesslog shows an extra line indicating the initial request has been proxied even for local URI. Applying the following patch resolves this behaviour: --- mod_proxy-old.c Fri Jun 18 12:04:56 2004 +++ mod_proxy.c Fri Jun 18 11:21:14 2004 @@ -154,7 +154,7 @@ if (!(r->parsed_uri.hostname && !strcasecmp(r->parsed_uri.scheme, ap_http_method(r)) && ap_matches_request_vhost(r, r->parsed_uri.hostname, - r->parsed_uri.port_str ? r->parsed_uri.port : ap_default_port(r)))) { + r->parsed_uri.port_str ? r->parsed_uri.port : htons(r->connection->local_addr.sin_port) ))) { r->proxyreq = STD_PROXY; r->uri = r->unparsed_uri; r->filename = ap_pstrcat(r->pool, "proxy:", r->uri, NULL); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
