아파치 리버스 프록시 : 프로토콜 핸들러 없음


20

아파치로 리버스 프록시를 구성하려고하는데 No protocol handler was valid for the URL오류가 발생 하여 이해할 수 없습니다.

이것은 아파치의 관련 구성입니다.

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
       Order deny,allow
       Allow from all
</Proxy>

ProxyPass        /gonvaled/examples/jsonrpc/output/services/ http://localhost:8000/services/
ProxyPassReverse /gonvaled/examples/jsonrpc/output/services/ http://localhost:8000/services/

요청이 다음과 같이 아파치에 도달하고 있습니다.

POST /gonvaled/examples/jsonrpc/output/services/EchoService.py HTTP/1.1

그리고 그들은 다음에 위치한 내 내부 서비스로 전달되어야합니다.

0.0.0.0:8000/services/EchoService.py

다음은 로그입니다.

==> /var/log/apache2/error.log <==
[Wed Jun 20 02:05:20 2012] [debug] proxy_util.c(1506): [client 127.0.0.1] proxy: http: found worker http://localhost:8000/services/ for http://localhost:8000/services/EchoService.py, referer: http://localhost/gonvaled/examples/jsonrpc/output/JSONRPCExample.safari.cache.html
[Wed Jun 20 02:05:20 2012] [debug] mod_proxy.c(998): Running scheme http handler (attempt 0)
[Wed Jun 20 02:05:20 2012] [warn] proxy: No protocol handler was valid for the URL /gonvaled/examples/jsonrpc/output/services/EchoService.py. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
[Wed Jun 20 02:05:20 2012] [debug] mod_deflate.c(615): [client 127.0.0.1] Zlib: Compressed 614 to 373 : URL /gonvaled/examples/jsonrpc/output/services/EchoService.py, referer: http://localhost/gonvaled/examples/jsonrpc/output/JSONRPCExample.safari.cache.html

==> /var/log/apache2/access.log <==
127.0.0.1 - - [20/Jun/2012:02:05:20 +0200] "POST /gonvaled/examples/jsonrpc/output/services/EchoService.py HTTP/1.1" 500 598 "http://localhost/gonvaled/examples/jsonrpc/output/JSONRPCExample.safari.cache.html" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19"

답변:


26

나는 문제를 발견했다. proxy_http모듈 (I 만했다 아파치 너무 활성화해야 proxy_html하고 proxy)


23

나를 위해, 아파치에서 httpd 2.4, 이것은 후행 슬래시가 없기 때문에 발생했습니다.

작동하지 않았다:

    <Proxy balancer://mycluster>
        BalancerMember http://192.168.111.7
        BalancerMember http://192.168.111.80
    </Proxy>
    ProxyPass / balancer://mycluster
    ProxyPassReverse / balancer://mycluster

일했다!

    <Proxy balancer://mycluster>
        BalancerMember http://192.168.111.7
        BalancerMember http://192.168.111.80
    </Proxy>
    ProxyPass / balancer://mycluster/
    ProxyPassReverse / balancer://mycluster/

( /끝에 추가 )


나를 위해 아파치 2.2.15, <kbd> / </ kbd>가 끝났습니다. 고마워!

Apache / 2.4.10 (Debian)에서 나를 도왔습니다. 이것은 문서화되어야합니다! 오류 메시지는 매우 난해합니다
— DeveloperChris

2

답을 찾는 사람들에게는 백엔드에 대한 URL 서비스 이름도 누락되었을 수 있습니다. LogLevel Debug 및 mod_proxy 및 mod_proxy_fcgi를 사용하면 다음을 볼 수있었습니다.

[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.

다행히 mod_proxy_fastcgi (나는 RHEL6에 아파치 2.2의 백 포트를 사용하고 있습니다)에 대한 코드에서 확인할 수 https://github.com/ceph/mod-proxy-fcgi/blob/master/mod_proxy_fcgi.c#L805 이되는, 코드 조각 :

if (strncasecmp(url, "fcgi:", 5) != 0) {
    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01077) "declining URL %s", url);
    return DECLINED;
}

당신이 로그를 자세히 보면 - 당신은 무엇을해야 볼 수 있습니다 - 문제 메시지가있는 코드를 볼 때 나는 단지 그것을 발견 fcgi://...잘못 철자가 같다fgci://...

따라서 당신이 볼 때 다음 declining URL중 하나를 의미합니다.

  • 서비스를 받아들이는 핸들러 (예 : fcgi :)가 없거나
  • 서비스 이름을 잘못 입력했습니다.

1
이 답변의 "이 오류가 표시되면 다음을 의미합니다 ..."부분으로 인해 찬성했습니다. 나는 이것이 대부분의 검색 자들을 올바른 방향으로 이끌 것이라고 생각한다.
— 3시
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.