Apache reverse proxy: no protocol handler
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2
--
Chapters
00:00 Apache Reverse Proxy: No Protocol Handler
01:07 Accepted Answer Score 29
01:22 Answer 2 Score 23
01:50 Answer 3 Score 2
03:58 Thank you
--
Full question
https://superuser.com/questions/439054/a...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#apachehttpserver #reverseproxy
#avk47
ACCEPTED ANSWER
Score 29
I found the problem. The proxy_http
module needs to be activated too in Apache (I had only proxy_html
and proxy
)
ANSWER 2
Score 23
For me, on apache httpd 2.4
, this happened because i was missing the trailing slash:
Did not work:
<Proxy balancer://mycluster>
BalancerMember http://192.168.111.7
BalancerMember http://192.168.111.80
</Proxy>
ProxyPass / balancer://mycluster
ProxyPassReverse / balancer://mycluster
Worked!
<Proxy balancer://mycluster>
BalancerMember http://192.168.111.7
BalancerMember http://192.168.111.80
</Proxy>
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
(added /
at the end)
ANSWER 3
Score 2
For those that come looking for answers, another possibility is the URL service name to backend too is missing. With LogLevel Debug, and mod_proxy and mod_proxy_fcgi, I was seeing the following:
[debug] proxy: fgci: found worker fgci://127.0.0.1:9000/var/www/html/.../index.php
[debug] mod_proxy.c(1026): Running scheme fgci handler (attempt 0)
[debug] mod_proxy_fcgi.c(800): [client ...] AH01076: url: fgci://127.0.0.1:9000/var/www/html/.../index.php proxyname: (null) proxyport: 0
[debug] mod_proxy_fcgi.c(805): [client ...] AH01077: declining URL fgci://127.0.0.1:9000/var/www/html/.../index.php
[warn] proxy: No protocol handler was valid for the URL /.../index.php. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
Thankfully the code for mod_proxy_fastcgi (I'm using a backport for Apache 2.2 on RHEL6) is available at https://github.com/ceph/mod-proxy-fcgi/blob/master/mod_proxy_fcgi.c#L805, which is this piece of code:
if (strncasecmp(url, "fcgi:", 5) != 0) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01077) "declining URL %s", url);
return DECLINED;
}
If you look closely at the logs -- I only noticed it when looking at the code that issues the message -- you'll see that what should be fcgi://...
is misspelt as fgci://...
So when you see declining URL
it means either:
- You don't have a handler loaded that accepts the service (eg. fcgi:), or
- you have misspelt the service name.