Proxypass 지시문에 ProxyPassReverse 지시문이 필요합니까?


20

모든 ProxyPass 지시문에 ProxyPassReverse 지시문이 필요합니까?

ProxyPass / http://foo.example.com:8080/  
ProxyPassReverse / http://www.example.com/

이 스 니펫을보고 들어오는 모든 트래픽이 foo.example.comfoo.example.com:8080으로 프록시되어 있음 을 이해합니다 . 두 번째 줄은 무엇을합니까?

답변:


15

이 지시문을 통해 Apache는 HTTP 리디렉션 응답의 Location, Content-Location 및 URI 헤더에서 URL을 조정할 수 있습니다 .

예를 들어, 로컬 서버의 주소가 http://example.com/ 이라고 가정하십시오 . 그때

ProxyPass /mirror/foo/ http://backend.example.com/
ProxyPassReverse /mirror/foo/ http://backend.example.com/
ProxyPassReverseCookieDomain backend.example.com public.example.com
ProxyPassReverseCookiePath / /mirror/foo/

http://example.com/mirror/foo/bar 에 대한 로컬 요청 이 내부적으로 http://backend.example.com/bar(ProxyPass가 제공하는 기능) 에 대한 프록시 요청으로 변환되도록 할 수 없습니다 . 또한 서버 backend.example.com 보내는 리디렉션을 처리합니다 : 때 http://backend.example.com/bar이 그에게로 리디렉션됩니다 http://backend.example.com/quux 아파치가이 조정 HTTP : / HTTP 리디렉션 응답을 클라이언트에 전달하기 전에 /example.com/mirror/foo/quux URL 구성에 사용되는 호스트 이름은 UseCanonicalName 지시문의 설정과 관련하여 선택됩니다.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.