Summary: | mod_proxy_balancer does not treat trailing slash like Proxypass directive | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Che Wang <cwang> |
Component: | Documentation | Assignee: | HTTP Server Documentation List <docs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nick.stielau |
Priority: | P2 | Keywords: | ErrorMessage |
Version: | 2.5-HEAD | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | Linux | ||
URL: | http://httpd.apache.org/docs/trunk/mod/mod_proxy.html#proxypass |
Description
Che Wang
2006-04-04 18:12:14 UTC
> ProxyPass /KenwoodAccess/ http://172.20.111.33:80/KenwoodAccess/ and > ProxyPass /KenwoodAccess/ balancer://KWA_cluster lbmethod=byrequests are different cases. In the first case you have a trailing slash at both ends in the second case you do not have this. > This will generate an error message in Apache logs: > > [Mon Apr 03 17:04:55 2006] [warn] proxy: No protocol handler was valid for the > URL /site/images/buts/forgotpassword.gif. If you are using a DSO version of > mod_proxy, make sure the proxy submodules are included in the configuration > using LoadModule. Please specify the request that leads to this error message. Please set also the LogLevel to debug and attach the output of your error_log file. *** Bug 39206 has been marked as a duplicate of this bug. *** I had the same issue, and this does not necessarily mean that is not a bug but I have at least discovered a workaround. In my case, within a certain Virtual Host I pass all requests to the Load Balancer. This received the same errors when configured as follows: ProxyPass / balancer://cluster nofailover=On ProxyPassReverse / balancer://cluster <Proxy balancer://cluster> BalancerMember ajp://10.0.1.102:8009 BalancerMember ajp://10.0.1.103:8009 </Proxy> But works if the configuration is changed to this: ProxyPass / balancer://cluster/ nofailover=On ProxyPassReverse / balancer://cluster/ <Proxy balancer://cluster/> BalancerMember ajp://10.0.1.102:8009/ BalancerMember ajp://10.0.1.103:8009/ </Proxy> I agree that the error message is misleading, but this problem is not limited to mod_proxy_balancer and the balancer scheme but also occurs with ProxyPass / http://www.somewhere.com (it must be ProxyPass / http://www.somewhere.com/) So the problem is really a misconfiguration on the user side that I mark as a WONTFIX. (In reply to comment #4) > ProxyPass / http://www.somewhere.com > > (it must be ProxyPass / http://www.somewhere.com/) > > So the problem is really a misconfiguration on the user side that I mark as a > WONTFIX. May be the manual should be updated, too, because three or four examples provided under the ProxyPass directive are using such invalid syntax. (In reply to comment #5) > > May be the manual should be updated, too, because three or four examples > provided under the ProxyPass directive are using such invalid syntax. Ok, agreed, but strictly speaking only the balancer example is wrong. ProxyPass /example http://backend.example.com is correct again. The basic rule for this is: If the left side of ProxyPass ends with a / the right side must also end with a /. If the right side of ProxyPass ends with a / but the left side does not this will cause // in the URL send to the backend which usually does not harm, but to play safe both sides really should end in the same manner. Maybe an idea for a sanity check that issues a warning to the error log during the configuration parsing of the ProxyPass directives if this is not the case. I have added a note to the documentation regarding trailing slashes: r409455 (http://svn.apache.org/viewvc?rev=409455&view=rev) backported to 2.2 <http://svn.apache.org/viewvc?rev=663989&view=rev> I think this is still a problem, because you cannot achieve the same behavior using the balancer as you can without using it: Not using balancer ProxyPass /MyService http://example.com:20000/MyService ProxyPassReverse /MyService http://example.com:20000/MyService this sends a request for /MyService?wsdl to http://example.com:2000/MyService?wsdl Using the balancer ProxyPass /MyService balancer://playlist_service_balancer <Proxy balancer://playlist_service_balancer> BalancerMember http://example.com:10000/MyService BalancerMember http://example.com:20000/MyService ProxySet lbmethod=byrequests </Proxy> There are no trailing slashing at all, yet this sends a request for /MyService?wsdl to http://example.com:2000/MyService/, forcing a trailing slash. Try using ProxyPass /MyService balancer://playlist_service_balancer/MyService <Proxy balancer://playlist_service_balancer> BalancerMember http://example.com:10000/ BalancerMember http://example.com:20000/ ProxySet lbmethod=byrequests </Proxy> |