루트를 포함하여 ProxyPass 전체 도메인을 Tomcat에


8

모든 요청을 Tomcat 서버에 프록시 하도록 VirtualHost example.com 을 구성했습니다.

ProxyPass / http://localhost:8088/app
ProxyPassReverse / http://localhost:8088/app

이 같은 URL에 대한 벌금을 작동 example.com/page 하지만 들어, example.com 및 example.com/ 나는이 리디렉션 응답, 아무것도 분명히 리드를 얻을.

HTTP/1.1 302 Moved Temporarily
Date: Wed, 06 Jul 2011 21:13:37 GMT
Server: Apache-Coyote/1.1             <-- the redirect comes from tomcat
Location: http://example.com/app/     <-- nonsense
...

이 문제를 해결하려면 어떻게해야합니까? 바람직하게는 Apache 설정에서.

Apache 2와 Tomcat 7을 사용하고 있습니다.

답변:


10

왜 그런지 잘 모르겠지만 이것이 수정입니다.

ProxyPass / http://localhost:8088/app/
ProxyPassReverse / http://localhost:8088/app/

(끝에 슬래시 추가)


8
슬래시는 항상 일치해야합니다. 로부터 mod_proxy를 문서 :If the first argument ends with a trailing /, the second argument should also end with a trailing / and vice versa. Otherwise the resulting requests to the backend may miss some needed slashes and do not deliver the expected results.
— 셰인 매든
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.