
CentOS 6.4 상자에 mod_proxy, mod_proxy_html(3.1.3) 및 mod_xml2enc를 사용하여 역방향 프록시를 설정했습니다.
프록시는 대상 서버를 잘 작동하지만 ASCII가 아닌 문자(내 경우에는 'äöüéàè')를 왜곡합니다.
이에 대한 해결책을 찾기 위해 지도 곳곳을 구글링했지만 소용이 없었습니다.
인코딩이 응답 헤더에 올바르게 지정되어 있으며 대상 서버(utf-8)의 인코딩과 동일합니다. 또한 다음을 통해 xml2enc에서 사용되는 인코딩을 명시적으로 설정해 보았습니다.
xml2EncDefault utf-8
그러나 효과가 없습니다.
다음과 같이 설정된 프록시 구성을 사용하여 가상 호스트에서 프록시를 실행하고 있습니다.
ProxyRequests off
ProxyHTMLLinks a href
ProxyHTMLLinks area href
ProxyHTMLLinks link href
ProxyHTMLLinks img src longdesc usemap
ProxyHTMLLinks object classid codebase data usemap
ProxyHTMLLinks q cite
ProxyHTMLLinks blockquote cite
ProxyHTMLLinks ins cite
ProxyHTMLLinks del cite
ProxyHTMLLinks form action
ProxyHTMLLinks input src usemap
ProxyHTMLLinks head profile
ProxyHTMLLinks base href
ProxyHTMLLinks script src for
ProxyHTMLLinks iframe src
ProxyPass /foo/ http://someserver.com/
ProxyPassReverse /foo/ http://www.someserver.com/
<Location /foo/>
SetOutputFilter INFLATE;proxy-html;DEFLATE
ProxyPassReverse /
ProxyPassReverseCookiePath / /foo
ProxyHTMLURLMap http://www.someserver.com /foo
ProxyHTMLURLMap http://someserver.com /foo
RequestHeader unset Accept-Encoding
</Location>
답변1
이 모든 것에서 'mod_proxy_html'이 결백한 것으로 밝혀졌습니다.
다음을 통해 인코딩을 선언합니다.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
문제가 사라지게 만들었습니다.
응답 헤더에 'Content-Type'이 올바르게 설정되었기 때문에 이는 약간 이상합니다.